cj333 cj333 - 2 months ago 5
MySQL Question

PHP MYSQL QUERY ORDER BY desc problem

I have two field name

$date
and
$time
.

date | time
2011/01/09 | 08:22:25
2011/01/09 | 13:00:55
2011/01/09 | 17:45:18
2011/01/09 | 17:30:26
2011/01/08 | 18:22:00
2011/01/08 | 12:06:39


How to let the newest before the oldest. I want them to be:

date | time
2011/01/09 | 17:45:18
2011/01/09 | 17:30:26
2011/01/09 | 13:00:55
2011/01/09 | 08:22:25
2011/01/08 | 18:22:00
2011/01/08 | 12:06:39


How to write a
select * from article order by...desc...
? Thanks.

Answer
SELECT * FROM yourtable ORDER BY date desc, time desc