Hi i m using Mysql 4.1 I hv a table with 1000 records with name,id(unique),datetime I need a query to search 250 records order by date and then need those sorted alphabatically. I am using this at present select distinct name,url2 from search order by word limit 250 but this send me first 250 records order by word I need lastest 250 records ordered by word Thanks Regards Alex
Try the following code: SELECT * FROM `search` ORDER BY datetime DESC , name ASC LIMIT 250; Code (markup): I am not sure if this is exactly what you need but should give you an idea on how to run your query.