本篇内容由猿道教育的课程内容整理而来。
我把MySQL的内容整理成9篇博客,学完这9篇博客虽不能说能成为大神,但是应付一般中小企业的开发已经足够了,有疑问或建议的欢迎留言讨论。
一、操作符
1、比较操作符
- 相等 =
select * from students where s_id='J16040252'
- 不相等 != or <>
select * from students where s_id!='J16040252'
- 小于和大于 < or >
- 比较操作符的组合 <= or >=
select * from students where age > 18
select * from students where age <=18
2、逻辑操作符
- IS NULL:用于和NULL值进行比较。
select * from students where height is null
select * from students where height is not null
- BETWEEN:定位最大值与最小值之间;语法: 列 BETWEEN 最小值 and 最大值。
select * from students where age between 18 and 28
select * from students where age