Page is a not externally linkable
Spire2001 - 5:08 pm on Jul 28, 2008 (gmt 0)
Small error in my original example: id ¦ file_name ¦ date_uploaded ¦ folder ¦ int_time "SELECT id, file_name, date_uploaded, folder, MAX(int_time) FROM tbl WHERE folder = 'docs' GROUP BY file_name"; Results returned are: id ¦ file_name ¦ date_uploaded ¦ folder ¦ int_time Note that the correct 'int_time' results are returned. They do not however correspond to the 'date_uploaded' field for the same row. data type of the 'int_time' field is INT(12). Again, what I would like to have is a single row for each unique file name within each folder, and for said row to be of the latest addition. Such as: id ¦ file_name ¦ date_uploaded ¦ folder ¦ int_time Each file name is returned once (per folder). Each row is the most recent, not the lowest 'id' #.
Thanks for your reply.
----------------------------------- --------------
1 ¦ name1.gif ¦ 281350Z Jul08 ¦ docs ¦ 0807281350
2 ¦ name1.gif ¦ 281353Z Jul08 ¦ docs ¦ 0807281353
3 ¦ name2.gif ¦ 281350Z Jul08 ¦ docs ¦ 0807281350
4 ¦ name2.gif ¦ 281355Z Jul08 ¦ docs ¦ 0807281355
5 ¦ name2.gif ¦ 281358Z Jul08 ¦ stuff ¦ 0807281358
--------------------------------------------------
1 ¦ name1.gif ¦ 281350Z Jul08 ¦ docs ¦ 0807281353
3 ¦ name2.gif ¦ 281350Z Jul08 ¦ docs ¦ 0807281355
----------------------------------- --------------
2 ¦ name1.gif ¦ 281353Z Jul08 ¦ docs ¦ 0807281353
4 ¦ name2.gif ¦ 281355Z Jul08 ¦ docs ¦ 0807281355