Re: [sqlite] Query on sorting (grouping, actually)

2004-05-24 Thread Kurt Welgehausen
This question comes up every couple of months or so. It's a basic misunderstanding of how grouping works. The answer in your case is select Visitor_ID, Action, Message, Timestamp from av2, (select Visitor_ID vid, max(Timestamp) mts from av2 where Action='I' or Action='O'

[sqlite] Query on sorting

2004-05-24 Thread yahoo
Hi, I'm developing a small reception application for staff to use. The app records visitors signing in and out of the building. CREATE TABLE av2 ( Activity_ID INTEGER PRIMARY KEY, Timestamp TIMESTAMP, Visitor_ID VARCHAR(8), Action VARCHAR(1), Message VARCHAR(255)); insert into av2