sql >> Base de Datos >  >> RDS >> Mysql

MySQL. Seleccionar rango de años

SELECT Make, Model, 
    CASE
      WHEN MIN(Year) = MAX(Year) 
        THEN MIN(Year)
      ELSE CONCAT(MIN(Year), '-', MAX(Year))
    END As Year,
    OtherColumns
FROM tableName
GROUP BY Make, Model, OtherColumns