MySQL查询语句(重点分类)

版权声明:本文为徐代龙原创文章,未经徐代龙允许不得转载。网络资源网站:xudailong.cc 福利网站:www.00reso.com 公众号:蛇崽网盘教程资源 https://blog.csdn.net/xudailong_blog/article/details/84069565
MySQL的查询是一个重点,主要查询操作包括以下内容(单表查询重点)
  1. 查询所有列
  2. 查询指定列
  3. 查询时添加常量列
  4. 查询时合并
  5. 查询时去除重复记录
  6. 条件查询
  7. 聚合查询
  8. 分页查询
  9. 查询排序
  10. 分组查询
  11. 分组查询后咨询
# 查询所有列
select * from student;
# 查询指定列
select id,name,gender from student;
# 查询时指定别名(as)
select id as '编号',name as '姓名' from student;
# 查询时添加常量列,添加一个java班级列
select  id ,name,gender,age,"java"  as '年级'   from student;
# 查询时合并列:合并列只能合并数值类型的,非数值类型的不可合并
select id,name,(servlet+jsp) as '总成绩' from student;
# 查询学生的性别, 男女去重
select distinct gender from student;
select distinct(gender) from student;
#条件查询(where)


多表查询重点:


个人网站:http://xudailong.cc

关注「蛇崽网盘教程资源」公众号 ,在微信后台回复「领取资源」,获取IT资源200G干货大全。

更多资源请访问:

https://blog.csdn.net/xudailong_blog/article/details/78762262

某课视频教程

https://xudailong.cc/2018/09/30/muke-courses/

关注「蛇崽网盘教程资源」公众号 ,在微信后台回复「领取资源」,获取IT资源200G干货大全。
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/xudailong_blog/article/details/84069565