tags:

views:

25

answers:

2

i have a table that has a serial number, date and time when that serial number was modified. i would like to retrieve the latest time and date when that particular serial number was modified. any suggestions? the dates and times are on different columns.

thanks

A: 

Assuming the data and time columns are of types that MySQL knows how to sort correctly (i.e. DATE and TIME types), this should work:

SELECT * FROM table_name
ORDER BY date_col DESC, time_col DESC
LIMIT 1
Jordan
A: 
Archimedix
Thanks to all it worked.