How to order by a known id value in mysql
Posted
by markj
on Stack Overflow
See other posts from Stack Overflow
or by markj
Published on 2010-05-05T00:25:21Z
Indexed on
2010/05/05
0:28 UTC
Read the original article
Hit count: 544
Hi, is it possible to order a select from mysql by using a known id first.
Example:
$sql = "SELECT id, name, date FROM TABLE ORDER BY "id(10)", id DESC
Not sure if the above makes sense but what I would like to do is first start ordering by the known id which is 10 which I placed in quotes "id(10)". I know that cannot work as is in the query but it's just to point out what I am trying to do.
If something similar can work I would appreciate it. Thanks.
© Stack Overflow or respective owner