第三章:数据查询语言DQL-条件查询(单条件或多条件)

直接学习: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) ;

发布了107 篇原创文章 · 获赞 6 · 访问量 968

猜你喜欢

转载自blog.csdn.net/weixin_43597208/article/details/105441476