Mysql
 sql >> Database >  >> RDS >> Mysql

MySQL. Seleziona l'intervallo di anni

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