How to GET Newest 30 records then SORT THEM ??
Posted on 2004-10-01
I am using mySQL as my DB provider.
I want to get the newest products in the table, the field is named: prod_new (DATE type)
"SELECT * FROM prod_detail ORDER BY prod_new DESC LIMIT 30"
This would get the latest items, because it is getting the date in DESC order.
BUt how would I be able to sort these records by the name?
"SELECT * FROM prod_detail ORDER BY prod_new DESC, prod_name ASC LIMIT 30"
I tried above, but as i suspected it orders the date then order the name.
What I want is that it gets the 30 records, and from the 30 records it will reorder them by their name regardless of their date.