今日下午学习mysql-查询

2023-12-22 06:40:18

多条件查询 and? or

and是左右两边都满足条件? or是只要满足一个条件就可以

案例展示

select *FROM st where (address="杭州" or address="香港") and math>=80;

空值查询

? ? is null?是空 not null 不是空

select *from st where englist is not null;

逻辑查询 > < >=? <=? !=(<>) between? 和not between

select *FROM st where math not between 80 and 90;
select *FROM st where math  between 80 and 90;
select *FROM st where math>= 90;
select *FROM st where math<= 90;
select *FROM st where math> 90;
select *FROM st where math< 90;

删除的区别

drop?删除表结构和数据 DDL

delete? 不会删除id自增DML

truncate 会删除id自增? ?会删除约束 DML

select 字段 from 表名 where 查询条件 group by 分组 having 条件=值

order by 字段 排序 desc asc limit start num

文章来源:https://blog.csdn.net/sxs04/article/details/135131472
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。