I have a log in table that have something like this:
tablelog
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
I have a query
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"
This return 3 executions but only I have 2... How can I fix this query???
Thank you!!
timestampinstead?