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

Come considerare NULL come data MAX invece di ignorarla in MySQL?

Prova questo:

SELECT ID, case when MAX(DATE IS NULL) = 0 THEN max(DATE) END AS DATE
FROM test
GROUP BY ID;