Mysql
 SQL >> Database >  >> RDS >> Mysql

Raggruppare NULL e stringhe vuote in MySQL

Puoi normalizzare NULL e stringa vuota con una CASE:

SELECT
  CASE
    WHEN text_field IS NULL OR text_field = '' THEN NULL
    ELSE text_field
  END AS new_field,
  other_field
FROM table_name;