I have 2 tables which I want to query from.
The first table (lets call it users
) has these columns: id
and name
.
The second table (lets call it transactions
) has these columns: user_id
, amount
and timestamp
.
How do I find out the latest timestamp in transactions
for each user in the users
table?
EDIT:
Thanks for all your answers so far! Really appreciate it. How about, if I want to select users with the latest timestamp greater than a certain value?