我有一个类似这样的登录表:
表日志
date | time | event | program | ordendate
20130722 070000 executing program1 20130722
20130722 070040 end ok program1 20130722
20130722 070100 executing program1 20130722
20130722 070140 end ok program1 20130722
我有一个查询
select a.date || a.time as datetimeStart,
b.date || b.time as datetimeStop,
a.program, a.ordendate
from tablelog a,
tablelog b
where a.date || a.time < b.date || b.time
and a.event = "executing"
and b.event = "end ok"
这会返回 3 次执行,但只有我有 2 次……我该如何解决这个查询???
谢谢!!