1. 等于(=):
SELECT * FROM your_table WHERE column1 = 100;
2. 不等于(<>或!=):
SELECT * FROM your_table WHERE column1 <> 100;
3. 大于(>):
SELECT * FROM your_table WHERE column1 > 100;
4. 小于(<):
SELECT * FROM your_table WHERE column1 < 100;
5. 大于等于(>=):
SELECT * FROM your_table WHERE column1 >= 100;
6. 小于等于(<=):
SELECT * FROM your_table WHERE column1 <= 100;
7. 空值判断(IS NULL):
SELECT * FROM your_table WHERE column1 IS NULL;
8. 非空值判断(IS NOT NULL):
SELECT * FROM your_table WHERE column1 IS NOT NULL;
9. 使用AND和OR组合多个条件:
SELECT * FROM your_table WHERE column1 > 50 AND column2 = 'value';
10. IN条件:
SELECT * FROM your_table WHERE column1 IN (1, 2, 3);
11. BETWEEN条件:
SELECT * FROM your_table WHERE column1 BETWEEN 50 AND 100;
这些比较条件允许你在查询中根据列的值进行条件筛选,以获取符合条件的数据。你可以根据实际需求组合这些比较条件,构建复杂的查询语句。
转载请注明出处:http://www.zyzy.cn/article/detail/11729/OceanBase