Q:

PHP SQL Order by date and id

This is my PHP SQL query:
SELECT * FROM Buchungen 
WHERE Buchungen.konto = '".$value_entry."'
ORDER BY datum DESC

Is it possible to order this by the newest id for each date? When i have 3 entries, from 18.11.2013, i want the newest entry on top. The latest entry has the largest id from this date. I don't want to add an time column in my sql table.

A:

Replace:
ORDER BY datum DESC

With:
ORDER BY datum DESC, id DESC

Basically, this means: Order by datum desc but whenever there are duplicated values for datum then order those values by id desc.

