要使用SQL篩選語句,您可以使用SELECT語句結合WHERE子句來實現。以下是一些常見的篩選語句示例:
SELECT * FROM 表名 WHERE 條件;
示例:
SELECT * FROM Customers WHERE Country = 'USA';
SELECT * FROM 表名 WHERE 條件1 AND 條件2;
SELECT * FROM 表名 WHERE 條件1 OR 條件2;
SELECT * FROM 表名 WHERE NOT 條件;
示例:
SELECT * FROM Customers WHERE Country = 'USA' AND City = 'New York';
SELECT * FROM Customers WHERE Country = 'USA' OR Country = 'Canada';
SELECT * FROM Customers WHERE NOT Country = 'USA';
SELECT * FROM 表名 WHERE 列名 = 值;
SELECT * FROM 表名 WHERE 列名 <> 值;
SELECT * FROM 表名 WHERE 列名 > 值;
SELECT * FROM 表名 WHERE 列名 >= 值;
SELECT * FROM 表名 WHERE 列名 < 值;
SELECT * FROM 表名 WHERE 列名 <= 值;
示例:
SELECT * FROM Customers WHERE Country = 'USA';
SELECT * FROM Customers WHERE Age <> 30;
SELECT * FROM Customers WHERE Age > 18;
SELECT * FROM Customers WHERE Age >= 18;
SELECT * FROM Customers WHERE Age < 30;
SELECT * FROM Customers WHERE Age <= 30;
這些是基本的篩選語句示例。請根據您的具體需求使用適當的語法和運算符。