表結構:選擇一個狀態
id
time (unixtimestamp)
tag (start,stop,fail,qs etc.)
text
job (unique number which identifies the running order)
我已經存儲像start
,stop
,fail
,qs
等一些機器狀態的數據庫。
我的問題是,我想列出每個狀態分隔的所有數據,如:select * from database where status='qs'
。
它工作正常,但下一步將檢查下一個狀態。這是我卡住的地方。
如果我得到下一個狀態,我想減去時間來獲得流逝的時間。
是否有爲您的狀態定義的順序?像start = 1,stop = 2 usw.? – Hockenberry 2015-02-06 20:32:03