Hi everyone!

I have a problem that I should solve in postgres sql, but I'm stuck.
The bare data is a table named activity_logs : activity_time (timestamp) | action (int4)|item 1 (varchar) | item 2 (varchar)|
This is a log table simplified.
activity_time: is a timestamp when a user login/logout is attempted.
Action: can be 1 - Login or 2 - Logout.
item 1: some product info (should be in the group...