get row (latest by date)

From: Date: Thu, 09 Jan 2003 13:04:03 +0000
Subject: get row (latest by date)
Groups: php.windows 
Request: Send a blank email to php-windows+get-17730@lists.php.net to get a copy of this message
Hi NG. I know this is probably very simple, but I've had no luck making it work :( I want 1 single row out of a table, that row must be the latest by date and time. The table looks like this (example MySQL): _______________________________________________ id | type_id | date | time | title | source | --------------------------------------------------------------- 128 | 1 | 2003-01-09 | 15:00:52 | some title | blabla | 129 | 1 | 2003-01-09 | 15:02:43 | some title 2 | blabla 2 | --------------------------------------------------------------- What i need is the SQL that would give me the latest created row of these 2 (i dont mean latest as in last_id) by date and time in this case the result should be the row with id = 129 because of the time. Please help... ~ Aidal

« previous php.windows (#17730) next »