MySql关键字汇总

本文详细介绍了 SQL 的基本语法,包括数据查询、插入、更新、删除等操作,涵盖了 select、insert into、update、delete from 等常用语句,并讲解了如何使用 where 子句来指定条件,如何通过 group by 和 having 进行分组筛选,以及如何利用 union 和 union all 实现结果集的合并。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

select ... from   查找

distinct    合并相同的项

limit /limit ... offset   限制输出

order by  排序

order by ... desc   排序,降序

where/ where ... between ... and ...   条件判断输出

where ... and   多条件,同时符合

where ... or     多条件,符合其中一个

where ... in     在某一个范围中

like    通配筛选

regexp   利用正则表达式筛选

concat   字段拼接

concat ... as   字段拼接后重命名

函数:

count avg max min sum  使用函数对列进行操作

group by    分组

having   分组后筛选

where ... group by ... having   先筛选再分组再筛选

union   组合查询,多个select

union all  组合查询,不合并相同信息

Match Against 搜索,match字段,against内容

Insert into   插入

update ... set  更新内容

delete from   删除

create   创建

alter table ... add/drop   增加/删除表字段

drop 删除表/库

rename  重命名



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值