Ok, I haven't passed MYSQL 101 yet and something I thought would be a
piece of cake has be stumped (it is almost 1a.m. thought ;)).
MYSQL: 3.23
TABLE:
file_id
member_id
file_name
file_upload_dat etime (datetime)
catagory
I want to find the 5 most recent files uploaded but only one per
user...
I tried
SELECT
member_id,
file_name,
MAX(file_upload _datetime) AS newest
WHERE
catagory = 1
GROUP BY
member_id
ORDER BY
newest DESC
LIMIT 3
and a few other variations but can only get "close." :( FYI: I didn't
execute the query above, just showing the logic so if there are typos
please ignore. ;)
TIA for any insights offered!
piece of cake has be stumped (it is almost 1a.m. thought ;)).
MYSQL: 3.23
TABLE:
file_id
member_id
file_name
file_upload_dat etime (datetime)
catagory
I want to find the 5 most recent files uploaded but only one per
user...
I tried
SELECT
member_id,
file_name,
MAX(file_upload _datetime) AS newest
WHERE
catagory = 1
GROUP BY
member_id
ORDER BY
newest DESC
LIMIT 3
and a few other variations but can only get "close." :( FYI: I didn't
execute the query above, just showing the logic so if there are typos
please ignore. ;)
TIA for any insights offered!
Comment