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___";(_只匹配一个任意字符)

最新文章

  1. 我是这么给娃娃取名的(使用 node.js )
  2. SQL SERVER普通用户需要什么权限才能执行sp_configure命令
  3. json原理和jquey循环遍历获取所有页面元素
  4. 我的第二个app上线:术购管家
  5. 打印多边形的菱形(for的嵌套)
  6. Flask-SQLAlchemy 学习总结
  7. KNN及其改进算法的python实现
  8. PHP 常用命令
  9. sql中int字段实现百分比
  10. 通过 ODBC 访问数据库获取数据集
  11. 联想G510 在新的SSD上安装Win8.1系统,启动的时候自己加载机械硬盘的Win8.1系统
  12. react生命周期,中间件、性能优化、数据传递、mixin的使用
  13. 阿里云centos 开启ipv6
  14. JVM内存结构(转)
  15. java设计模式--Builder模式
  16. dbms_monitor开启/关闭会话跟踪
  17. Rendering Resources
  18. 从零开始的Python学习Episode 19——面向对象(2)
  19. Django-Form表单(验证、定制、错误信息、Select)
  20. mysql_connect的$new_link参数

热门文章

  1. OpenGL光照计算中法线矩阵原理及推到过程
  2. golang 入门之环境搭建
  3. [枚举]P1089 津津的储蓄计划
  4. JavaCV 采集摄像头和麦克风数据推送到流媒体服务器
  5. kubernetes 降本增效标准指南| 资源利用率提升工具大全
  6. (二)基于商品属性的相似商品推荐算法——Flink SQL实时计算实现商品的隐式评分
  7. Mybatis-plus 下
  8. Mybatis3源码笔记(六)SqlSession执行过程
  9. k8s 安装 rabbitMQ 单机版
  10. DDD实践反思