On 3/14/08, Bjørn T. Nøstdahl <[EMAIL PROTECTED]> wrote: > > Can you give an example of the output? For example, do you want to > > know the difference between A0001 and A0002 or between to records with > > the same code? > > > 20080314100030 A0001 (9min 30sec to next status change) > 20080314101000 A0002 (7min to next status change) > 20080314101700 A0000 (3min to next status change) > 20080314102000 A0002 (1min to next status change) > 20080314102100 A0000 > > Expected output: (The total time within that status) > A0000 300 (3min) > A0001 930 (9min 30sec) > A0002 800 (7min + 1min) >
SELECT Code, max(TimeStamp) -min(TimeStamp) AS TimePassed FROM Log GROUP BY Code; _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users