Ask Learn
Preview
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
先建立測試資料表,如下:
-- 1. 查詢資料表中所有的資料
SELECT * FROM tblCustomer
-- 2. 使用『= NULL』查詢欄位為 NULL 的資料,
-- 會找不到資料,但確實有 LastName 為 NULL 的資料
SELECT * FROM tblCustomer WHERE LastName = NULL
-- 3. 使用『IS NULL』查詢欄位為 NULL 的資料
SELECT * FROM tblCustomer WHERE LastName IS NULL
-- 4. 使用『IS NOT NULL』查詢欄位不為 NULL 的資料
SELECT * FROM tblCustomer WHERE LastName IS NOT NULL
-- 筆者使用的環境 Vista w/ SP1 + SQL Server 2005 Dev w/ SP2
-- 5. 查詢 SQL Server 版本
SELECT @@VERSION
Hope this help.
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign in