Ver Mensaje Individual
  #4 (permalink)  
Antiguo 08/06/2015, 11:23
andrescruz
 
Fecha de Ingreso: enero-2011
Mensajes: 5
Antigüedad: 13 años, 3 meses
Puntos: 0
Respuesta: Como seleccionar y agrupar columnas con MAX y MIN

Esta fue la solución:

Código MySQL:
Ver original
  1. select atmint.mintemp, atmint.mintempdate,
  2.        atmaxt.maxtemp, atmaxt.maxtempdate,
  3.        atminwc.minwindchill, atminwc.minwindchilldate
  4. from (select min(mintemp) as mintemp, max(maxtemp) as maxtemp, min(minwindchill) as minwindchill
  5.       from archivetable
  6.      ) a join
  7.      archivetable atmint
  8.      on atmint.mintemp = a.mintemp join
  9.      archivetable atmaxt
  10.      on atmaxt.maxtemp = a.maxtemp join
  11.      archivetable atminwc
  12.      on atminwc.minwindchill = a.minwindchill