2013-08-28 64 views

回答

7

您可以使用CASEIS NULL(或IS NOT NULL):

SELECT CASE 
     WHEN ReturnDate IS NULL THEN 'It is null' 
     ELSE 'It is not null' 
     END AS IsItNull 
FROM dbo.tablename .... 

如果需要篩選NULL/NOT NULL值也可以使用IS NOT NULL

WHERE ReturnDate IS NOT NULL ... 
0

如果你不想選擇它爲空的任何記錄,使用類似:

SELECT ReturnDate 
FROM <joins> 
WHERE ReturnDate IS NOT NULL AND <conditions> 
0

檢查returnDate的 「IS NULL」

0

嘗試此查詢

SELECT ReturnDate 
FROM joins 
WHERE conditions AND ReturnDate IS NOT NULL;