Ver Mensaje Individual
  #1 (permalink)  
Antiguo 11/03/2013, 14:37
dark_17
 
Fecha de Ingreso: noviembre-2012
Ubicación: Villa Maria, Peru
Mensajes: 46
Antigüedad: 11 años, 6 meses
Puntos: 0
Problemas con ORDER BY y GROUP BY

Tengo esta consulta
Código:
SELECT
h.idhabitacion,
h.descripcionh,
h.habit_x_hotel,
ho.descripcionho
FROM habitacion h
INNER JOIN hotel ho ON h.habit_x_hotel = ho.idhotel
where h.habit_x_hotel = '1'
GROUP BY h.idhabitacion
ORDER BY h.habitacionh DESC
pero no me ordena por la habitacion, me lo deja como estaba,
lo curioso es que si "hace caso" cuando quito el group by:

Código:
SELECT
h.idhabitacion,
h.descripcionh,
h.habit_x_hotel,
ho.descripcionho
FROM habitacion h
INNER JOIN hotel ho ON h.habit_x_hotel = ho.idhotel
where h.habit_x_hotel = '1'
ORDER BY h.habitacionh DESC
ahi si me funciona, ¿a que se debe?