📜  mysql case when null - SQL 代码示例

📅  最后修改于: 2022-03-11 15:04:50.807000             🧑  作者: Mango

代码示例1
SELECT IF(guides.colName IS NULL, 'Yes','No') FROM tableName;

-- Or
SELECT
    CASE 
      WHEN colName IS NULL THEN 'Yes'
      ELSE 'No'
    END
FROM tableName;