I have release date in database as:
release_date
2010-12-02 00:00:00
and i have to get 50 rows from the data order by release date desc. Can anyone tell me how can i implement this in mysql sql query, some thing like
SELECT data.content,item.value
FROM contents
AS data
JOIN items
AS item
WHERE data.id=item.content_id
ORDER BY data.release_date
please help, any idea will be highly appreciated.
EDIT
I am not asking how to limit it, but my problem is this query makes my script to run forever. Sorry for not clearing this before.
EDIT 2
contents
id | content | Comment | release_date
items
id | content_id | name | release_date
my both tables. Both have around 250000 rows
dateperfectly. It should be OK to sort it withORDER BY data.release_date DESCwithout converting it to UNIX Timestamp