› MySQL 5.5 Community Server
› MySQL 5.6 Community Server
› Percona Configuration Wizard
› XtraBackup 搭建主从复制
Great Sites on MySQL
› Percona
› MySQL Performance Blog
› Severalnines
推荐管理工具
› Sequel Pro
› phpMyAdmin
推荐书目
› MySQL Cookbook
MySQL 相关项目
› MariaDB
› Drizzle
参考文档
› http://mysql-python.sourceforge.net/MySQLdb.html
KagamineLenKai2
V2EX  ›  MySQL

各位 dalao…我又来求助了…

  •  
  •   KagamineLenKai2 · Aug 31, 2016 · 3284 views
    This topic created in 3689 days ago, the information mentioned may be changed or developed.

    昨天发了个贴,各位 dalao 表示看不明白需求,于是我重新整理了一下…
    这里是个 log 表,所有人的操作都会在这里记录下来。 ol-id 是这个表的主键。

    然后把这个 log 表里的信息拼成下图所示的这种表

    但是我遇到了一个麻烦……
    为了表述清楚,先把
    where before_status=10005100 and end_status=10005200
    称为 a
    where before_status=10005200 and end_status=10002300
    称为 b
    a 状态可能触发 b 状态,但 b 状态不只会被 a 处罚,所以我要怎么写才能确定这个 b 状态是不是由 a 触发的?
    目前有个想法是根据 ol-id 来进行判断,如果 a 状态下有两个同 apply-id 的 b 状态,取 ol-id 最接近的那个。然而……我不会……撑死会写子查询的我一脸懵比……
    下面附上 excel ,求 dalao 指点……
    百度云

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   829 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 22ms · UTC 22:37 · PVG 06:37 · LAX 15:37 · JFK 18:37
    ♥ Do have faith in what you're doing.