ISNULL()函數的基本用法:ISNULL(expression, value)
使用ISNULL()函數進行條件判斷:
SELECT column1, column2, ISNULL(column3, ‘N/A’) AS column3
FROM table_name
SELECT column1, column2, ISNULL(column3, 0) + ISNULL(column4, 0) AS total
FROM table_name
SELECT column1, column2, ISNULL(column3, ‘’) + ISNULL(column4, ‘’) AS full_name
FROM table_name
SELECT column1, column2, ISNULL(column3, GETDATE()) AS date
FROM table_name