直接学习:https://edu.csdn.net/course/play/27328/362525
条件查询(单条件或多条件):
#where 子句单条件查询:
1、select * from employee where sex = ‘男’;
2、select * from employee where sex != ‘女’;
3、select * from employee where sex <> ‘女’;
4、select * from employee where salary >=10000;
5、select * from employee where salary between 8000 and 10000 ;
#where 子句多条件查询:
1、select * from employee where sex = ‘男’ and salary >=10000 ;
2、select * from employee where sex = ‘男’ or salary >=10000 ;
3、select * from employee where sex = ‘男’ and salary <=4000 or salary >=10000 ;
4、select * from employee where sex = ‘男’ and (salary <=4000 or salary >=10000) ;
备注:sql操作符中,不等号(!=,<>),查询出来的结果集不包含有当前字段为null的数据
第三章:数据查询语言DQL-条件查询(单条件或多条件)
最新推荐文章于 2023-04-27 11:22:26 发布