首页 > 数据库 >SQL之过滤数据

SQL之过滤数据

时间:2022-09-30 15:11:20浏览次数:43  
标签:name 数据 过滤 SQL table where col select

主要是WHERE关键字的使用,对分组前的数据进行过滤

1、where子句操作符

  

   以上有些操作是冗余的,注意并非DBMS都支持不同的写法,具体要看

2、检查单个值

1 select
2 col_name
3 from 
4 table_name
5 where
6 col_name < num;

3、不匹配检查

1 select
2 col_name
3 from
4 table_name
5 where
6 col_name != 'str'

4、范围值检查

  使用BETWEEN操作符

1 select
2 col_name
3 from
4 table_name
5 where
6 col_name
7 between num and num2;

5、空值检查

1 select
2 col_name
3 from
4 table_name
5 where
6 col_name
7 is null;

 

标签:name,数据,过滤,SQL,table,where,col,select
From: https://www.cnblogs.com/shixiaogu/p/16744966.html

相关文章