本文概要
- SQL“OR”实例与SQL SELECT
- SQL“OR”实例与SQL INSERT
- SQL“OR”实例与SQL UPDATE
- SQL“OR”实例与SQL DELETE
让我们来看看OR条件的语法:
SELECT columns
FROM tables
WHERE condition 1
OR condition 2;
SQL“OR”实例与SQL SELECT
SELECT *
FROM suppliers
WHERE city = 'New York'
OR available_products >= 250;
SQL“OR”实例与SQL INSERT你可以看到在下面的例子是如何的SQL“OR”条件,使用SQL INSERT语句。
【SQL OR条件子句】例如:
INSERT INTO suppliers(supplier_id,supplier_name)
SELECT account_no,name
FROM customers
WHERE city = 'New Delhi'
OR city = 'Ghaziabad';
SQL“OR”实例与SQL UPDATE例如:
UPDATE suppliers
SET supplier_name = 'HP'
WHERE supplier_name = 'IBM'
OR available_product >36;
SQL“OR”实例与SQL DELETE例如:
DELETE FROM suppliers
WHERE supplier_name = 'IBM'
OR employee <
=100;
推荐阅读
- SQL WITH子句
- SQL AND条件子句
- SQL SELECT NULL语句
- SQL WHERE子句
- SQL SELECT SUM函数
- SQL SELECT DATE查找日期
- SQL SELECT从多个表查找
- SQL SELECT IN语句
- SQL SELECT AS语句