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'
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
2 matches
Mail list logo