您现在的位置是:网站首页>Mysql>mysql where子句Mysql

mysql where子句

adminMysql43人已围观


where 是针对元素进行操作,所有where之后的语句,都是针对数据结果进行操作,而不是是针对数据表


--where子句
---查询学生id为1,3,5,6,
select * from student where id = 1 or id = 3 or id = 5 or id = 6;
----简化
select * from student where id in (1,3,5,6);

--between and
between A and B(A 必须小于等于B)
--查询2-5id的学生
select * from student where id 2 and 5;

--null运算
---select 1+null;
---select 2*null;
---select 3 and null
---结果


--查询id为null的学生
--错误
select * from student where class_id = null;

--正确
select * from student where class_id is null;




站点信息

  • 建站时间:2019-3-10
  • 网站程序:ThinkPHP PHP MYsql
  • 路由说明:全站静态化+api
  • 统计数据百度统计
  • 登陆方式:githua授权登陆
  • 个人邮箱:2584496361@qq.com
  • 个人Q Q2584496361
  • 业务咨询:有需要建站朋友欢迎咨询