I have a database with a date field called artdate. Basically, I am trying to group the records by descending date, but I want to display the last record inserted for each date first. I can't figure out how to do this. Perhaps, I have to input an auto_increment field or maybe a timestamp.
So when I currently do:
select * order by artdate desc;
I get the articles by artdate desc, but the first record in the database for each date comes first, I want it to comes last.
I see how I could do this with a second field auto_increment then I would do:
select * order by artdate desc, auto_increment asc
But I don't want to have to add a field unless I have to.
If I had a timestamp field instead of a date field I guess I could do:
select *, date_format(timestampfield, '%m,%d,%y) as my date order by mydate desc, timestampfield desc;
(is there anyway to select timestamp fields as dates without using the date_format method above?)
Thanks