Ver Mensaje Individual
  #3 (permalink)  
Antiguo 05/11/2010, 17:05
jurena
Colaborador
 
Fecha de Ingreso: marzo-2008
Ubicación: Cáceres
Mensajes: 3.735
Antigüedad: 16 años, 1 mes
Puntos: 300
Respuesta: Duda con order by y 0

SELECT campo1, campo2, campo3 FROM tabla WHERE id=50 where orden > 0 ORDER BY orden, campo1
UNION ALL
SELECT campo1, campo2, campo3 FROM tabla WHERE id=50 where orden = 0 ORDER BY campo1