逻辑运算符
可以合并两个或更多条件。条件必须由 AND
或 OR
相关联,例如:
复制
salary = 40000 AND exempt = 1
逻辑 NOT 运算符用于反转含义,例如:
复制
NOT (salary = 40000 AND exempt = 1)
复制
SELECT * FROM Sales_Data WHERE Sales_Data.Company_Name
NOT LIKE '%University' AND Sales_Data.Amount > 3000
SELECT * FROM Sales_Data WHERE (Sales_Data.Company_Name
LIKE '%University' OR Sales_Data.Amount > 3000)
AND Sales_Data.Salesperson_ID = 'SP-1'