tags:

views:

18

answers:

1

my table has the following fields

videos
|id| |average| |views|

now i select some field from database, and order them by average

SELECT `id` from `videos` order by `average`

nut i need the second ordering by "views", i.e. if there are two rows vith equal "average", i want to order them by "views". How can i do that? thanks

+4  A: 
ORDER BY `average`, `views`

You can order by as many fields as you wish. DESC can also be added after any field(s) to reverse the order.

Matti Virkkunen
ooops, it's so simple:) thanks;)
Syom