Select Last Entries from MySQL
I have a log and I want to list the last time an entry was made by each of the users
SELECT user_id, MAX( log_date ) AS date,
DATE_FORMAT( MAX( log_date ) , "%M, %Y" ) AS english_date
FROM log_table
GROUP BY user_id
I’m not sure if this is the best way. The other options is to use WITH ROLLUP, I didn’t look into that option. This one seems to work, the only iffy part is the MAX(log_date), I may be pushing it just a bit ![]()