Page 1 of 1

mysql order by

Posted: Mon Mar 19, 2007 10:49 am
by hame22
Hi

I have a query:

Code: Select all

$result = mysql_query("Select * from venue_dir where moderated = 'Y' order by ven_enhanced DESC, ven_name ASC limit $offset, $limit ");
The results are ordered by whether or not they are enhanced and then if then in alphabetical order of their name.

What I would like to do is take the results that are enhanced and randomise their order.

Can this be done and how would I do it?

Thanks in advance

Posted: Mon Mar 19, 2007 10:51 am
by feyd
I don't think you can do it in a single basic query. A union, maybe, if your MySQL version supports ordering in the sub-queries.