I have two tables: Users and Logs, i use this query to get user info from table 'Users' and user's last access log from table 'Logs'
SELECT users.*,logs.* FROM users LEFT JOIN logs on users.id=logs.user_id GROUP BY logs.user_id
The problem is there are several log records in table 'Logs' for some users so mysql graps the first log record for user (Older Record) but i need mysql to grab the last log record for each user so i can get the last active date!
Any idea?
2007-07-15
05:48:03
·
4 answers
·
asked by
Aria
2
in
Computers & Internet
➔ Programming & Design