
24/05/2010, 11:16
|
 | | | Fecha de Ingreso: septiembre-2009
Mensajes: 182
Antigüedad: 15 años, 5 meses Puntos: 0 | |
Respuesta: error sintaxis UNION Que onda, pues lo que puedes hacer es muy facil , ponlos al final los order by o si no sale asi pues usa ese query anidado
poner el order by al final
select "FECHA_ENTREVISTA", "FECHA_ALTA" FROM abalia.candidatos
where
"FECHA_ENTREVISTA" is not null
and "FECHA_ALTA" is not null
union
select "FECHA_ENTREVISTA", "FECHA_ALTA" FROM abalia.candidatos
where
"FECHA_ENTREVISTA" is null
and "FECHA_ALTA" is null order by "FECHA_ENTREVISTA" desc,"FECHA_ALTA" desc
o
select * from (
select "FECHA_ENTREVISTA", "FECHA_ALTA" FROM abalia.candidatos
where
"FECHA_ENTREVISTA" is not null
and "FECHA_ALTA" is not null
union
select "FECHA_ENTREVISTA", "FECHA_ALTA" FROM abalia.candidatos
where
"FECHA_ENTREVISTA" is null
and "FECHA_ALTA" is null ) as todo order by 1 desc, 2 asc
o si estoy mal dime que ahora que lo pienso no me qued amuy claro esta parte
' y luego lo que null ordenados por la fecha Alta.' |