在MySQL中,可以使用以下方法處理NULL值:
SELECT *
FROM table_name
WHERE column_name IS NULL;
SELECT COALESCE(column_name, 0) AS new_column_name
FROM table_name;
SELECT *
FROM table_name
WHERE column_name IS NOT NULL;
SELECT IFNULL(column_name, 'NA') AS new_column_name
FROM table_name;
SELECT
CASE
WHEN column_name IS NULL THEN 'Unknown'
ELSE column_name
END AS new_column_name
FROM table_name;