Ver Mensaje Individual
  #20 (permalink)  
Antiguo 13/05/2008, 11:39
Avatar de Sergestux
Sergestux
 
Fecha de Ingreso: agosto-2007
Ubicación: Tapachula
Mensajes: 1.218
Antigüedad: 16 años, 8 meses
Puntos: 20
Re: Select Con Grupos¿?

Mira lo que dice la definicion de UNION
Cita:
UNION Clause

The UNION clause has this general form:
select_statement UNION [ ALL ] select_statement

select_statement is any SELECT statement without an ORDER BY, LIMIT, FOR UPDATE, or FOR SHARE clause. (ORDER BY and LIMIT can be attached to a subexpression if it is enclosed in parentheses. Without parentheses, these clauses will be taken to apply to the result of the UNION, not to its right-hand input expression.)
En conclusion, encierra entre parentesis los campos de ordenamiento, d elo contarrio el orden se aplica al resultado final de la UNION