![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
10/01/2013, 18:35
|
![Avatar de dashtrash](http://static.forosdelweb.com/customavatars/avatar175709_1.gif) | Colaborador | | Fecha de Ingreso: abril-2007 Ubicación: Ni en Sevilla,ni en Sanlúcar..qué más da..
Mensajes: 927
Antigüedad: 17 años, 10 meses Puntos: 270 | |
Respuesta: Ordenar consulta Si la tabla se llama 'yy', y el campo que contiene el 0 se llama 'xx':
ordenacion ascendente, y luego los que contienen '0':
SELECT * FROM YY ORDER BY FIELD(xx,0), xx asc;
ordenacion descendente, y luego los que contienen '0' (aunque en tu caso coincida con hacer simplemente 'DESC', lo siguiente sirve para cualquier caso:)
SELECT * FROM YY ORDER BY FIELD(xx,0), xx DESC; |