where优先级
select name from emply where id >5;
先找表from emply
再找条件 where id >5
最后打印 你想打印的字段
可以把select看成打印
优先级为from->where-->select
先找到表,然后where一条条数据过滤,发现符合的就扔给select,select再梳理出自己需要的数据进行打印。
#where
select id,name,age from employee where id > 7;
select name,post,salary from employee where post='teacher' and salary > 8000;
select name,salary from employee where salary >= 20000 and salary <= 30000;
select name,salary from employee where salary between 20000 and 30000;
select name,salary from employee where salary < 20000 or salary > 30000;
select name,salary from employee where salary not between 20000 and 30000;
select * from employee where age = 73 or age = 81 or age = 28;
select * from employee where age in (73,81,28); 选一个
select * from employee where post_comment is Null; 不可以=Null 要用is去判断
select * from employee where post_comment is not Null;
select * from employee where name like "jin%"; %等于后面任意匹配(即任意长度任意字符)
select * from employee where name like "jin___";(_只匹配一个任意字符)
最新文章
- 我是这么给娃娃取名的(使用 node.js )
- SQL SERVER普通用户需要什么权限才能执行sp_configure命令
- json原理和jquey循环遍历获取所有页面元素
- 我的第二个app上线:术购管家
- 打印多边形的菱形(for的嵌套)
- Flask-SQLAlchemy 学习总结
- KNN及其改进算法的python实现
- PHP 常用命令
- sql中int字段实现百分比
- 通过 ODBC 访问数据库获取数据集
- 联想G510 在新的SSD上安装Win8.1系统,启动的时候自己加载机械硬盘的Win8.1系统
- react生命周期,中间件、性能优化、数据传递、mixin的使用
- 阿里云centos 开启ipv6
- JVM内存结构(转)
- java设计模式--Builder模式
- dbms_monitor开启/关闭会话跟踪
- Rendering Resources
- 从零开始的Python学习Episode 19——面向对象(2)
- Django-Form表单(验证、定制、错误信息、Select)
- mysql_connect的$new_link参数