10.1 简单数据记录查询

SELECT field1,field2,...fieldn
FROM table_name;

  “*” ——查询所有记录

SELECT * FROM table_name;

  DISTINCT——避免重复数据查询

SELECT DISTINCT field1,field2,...fieldn
FROM table_name;

  AS——修改字段名

SELECT field1 【AS】 otherfield1,field2 【AS】 otherfield2
FROM table_name;

  CONCAT——设置显示格式

SELECT CONCAT(ename,'的年龄为',eage)
FROM table_name;

  

10.2 条件数据记录查询

  MySQL中,通过关系运算符和条件运算符来编写“条件表达式”。

SELECT field1,field2,...fieldn
FROM table_name
WHERE CONDITION;

  注意:通过"&&"符号连接查询条件。

  BETWEEN AND——判断字段的数值是否在指定范围内

SELECT field1,field2,...fieldn
FROM table_name
WHERE field 【NOT】 BETWEEN VALUE1 AND VALUE2;

  IS NULL——判断字段的数值是否为空

SELECT field1,field2,...fieldn
FROM table_name
WHERE field IS 【NOT】 NULL;

  IN——判断字段的数值是否在指定集合中

SELECT field1,field2,...fieldn
FROM table_name
WHERE field 【NOT】IN (value1,value2,value3,...valuen);

  LIKE “%”——模糊查询,“_”——通配符查询,LIKE '%%'表示查询所有数据。

SELECT field1,field2,...fieldn
FROM table_name
WHERE field LIKE value;

  NOT LIKE 也可以通过逻辑非运算符(NOT)来实现:

SELECT field1,field2,...fieldn
FROM table_name
WHERE field NOT LIKE value; SELECT field1,field2,...fieldn
FROM table_name
WHERE NOT field LIKE value;

  

10.3 排序数据记录查询

1. 升序排序-ASC

SELECT *
  FROM table_name
    ORDER BY field ASC;

ORDER BY默认升序排序。

降序排序-DESC

SELECT *
  FROM table_name
    ORDER BY field DESC;

2. 多字段排序

SELECT *
FROM table_name
ORDER BY field1 【ASC】, field2 DESC;

10.4 限制数据记录查询数量

SELECT field1,field2,...fieldn
FROM table_name
WHERE CONDITION
LIMIT OFFSET_START,ROW_COUNT;

OFFSET_START为起始偏移量,不指定时默认为0;ROW_COUNT表示显示的行数。

10.5 统计函数和分组数据记录查询

1. 统计函数

COUNT():统计表中记录总数
AVG():计算字段值的平均值
SUM():计算字段值的总和
MAX():查询字段值的最大值
MIN():查询字段值的最小值

注意:如果所操作的表中没有任何数据记录,COUNT()函数返回0,其他函数返回NULL。

2. 分组查询

  GROUP BY- 按照field字段值分组,显示每组中的一条记录。

SELECT field1,field2,...fieldn
FROM table_name
WHERE CONDITION
GROUP BY field;

实现多个字段分组查询:

SELECT function()
FROM table_name
WHERE CONDITION
GROUP BY field1,field2;

  GROUP_CONCAT-显示每个分组中的指定字段值:

SELECT GROUP_CONCAT(field1)
FROM table_name
WHERE CONDITION
GROUP BY field;

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoMAAACgCAIAAAD4q/FoAAAY2ElEQVR4nO2d+Y8dx3HH+7+JHSOBRdlxLsqyLfEQz+Uh3ocsUxQp2QlgBDn+o9wJZCcy4kRjxRa5FMWbFMVrKZKyeIkWEcAo5ADyw/M+zU53VVf3HN3T8/38IMyrqa76VvV0t3a57z1z9dNfv3zkhwYAAAAAg0NE5tKdp9sO/0lqJQAAAMAUISJz5vrDjXteHyBZVcO2t4xTufAmtf25FIKzUq2+wOGRJ0XuniZahBhZ0kQIfQ65J5m7Dn2e4/JyLzVTrNGp198rmcjog66eN9sN8zuDiMyJS3de2Ha4pwQ2znr0RWpmd/5SDq7xrz8x9ksl7aew1wfRuQyUfbZL6+p5bfmcFADXZ++1xlm+FacnIpd9bQ804rrL6pHISkxXdPK8cc8D5ncGEZl3Tl9bvX53H9GdcMUoi1Su9uiMcsy4mWg5f70+i6GrqI/+eIVp7IUhNNZ5zfkr587bVU18296JTkFehg9DhpLaEDfv9ljueXC+9NoT0pMkIjJv/+Li7317a2XhzO1srnPZOCdMrkRTpHJ46DRzj0iEwoYz10+uyY1blYUcnIuvqSj0Wgil0SPrjEikySvUIvhX/O4j1OVMFyTee0vWpqnXm052kPPaMjRxuJYGSXIKc/Zf48/dsrMLwjLR6dWvqcWZy/Dz2EjKDdenHr5vXmFcUq7S+jURmbf+4/RX/3h9vUfCgLqb7MAplssIKpKzC8V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ob6OTe6nxl91kGW2ulekAAAAoiX8/seDM3ZJPEf3mXlmY8JPYq1MuTaOzMYrT743P+QtxBBn6emW7Nx0AAAAN+IwtAAAAICU4iQEAAICU4CQGAAAAUoKTGAAAAEgJTmIAAAAgJUT0/49bKg7kSbohAAAAAElFTkSuQmCC" alt="" />

  HAVING-实现条件限制分组数据记录

SELECT function()
FROM table_name
WHERE CONDITION
GROUP BY field1,field2,...fieldn
HAVING CONDITION;

举例说明:

SELECT deptno,AVG(sal) average,GROUP_CONCAT(ename) enames,COUNT(ename) number
  FROM t_employee
    GROUP BY deptno
    HAVING AVG(sal)>2000;

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoMAAACVCAIAAACsHGd2AAAV+klEQVR4nO2d6c8dVXKHz9+TKFGG0SibQFGGxca7DRi8M2xjYEaRoijL35QoiUiUiTLJ3EQJxizezWLjBQyDsY0HFCkqZZHy4fJervucqlPndN/bfbuf5wPqrq5T9avq0+fwvn5v3/CX//Dvv/aDPwwAAACwdkQk/NXP/uPXf/uHfSsBAACYIiIS/vof3/yN33m0byUAAABTRETC3/zTqd/8vcf7VgIAADBFRCT87c/f+q3ff2INyWZLxPaWcWYpskljfy2F4exU6y9w/dg3xe6eJ1qFGFvSRCidh9pM1o5L53NdXu3Uc4s9Ov36V8pAZKyCruZb7Mb9nSMi4Y1/Pv29h7etKEFMsh5/kZ67uzi1g3v8l2dMfOqk/S1c6URMPgbOPseldTVfW86TEaD1OXvscbYv1empyBUfxwOD+dwNakoMSkxXdDLftPnA/Z0jIuGNf3n7oYe3ryJ6Eq0YZ5HOp706ox2z7k60vH8rnYulT9Eq+pMV5rGPDKOxyWPN33nvsl31xI/tneg05A1wMgxQUhvq7ns8VpsPydOsvUdWJElEwt/94u3vP7J9FpHMnWxu8rFJ3jC7Ek+RzuGlt1mbIhUKG85aP7UmNy7NIuzgWnxPRaXHRiiPHltnRSJPXqMWw3+mrz5GXcl0ReKzl2xtnnqz6WwHO28swxNHa2mRpKSw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BwAAyyT+dto/2FjZjWNt52iZvXQX8cSxPSuCh6WdzxlT86/YOJOe2kCnME9GAAAwaPUXW0k3I05jF8n6F2UvjePR4NHfRqd26vG33WwZbY6d6QAAwElzJ17GHml4apfsXcS/uCel2jtHUQme0jw6G6M0/dn4mr8Rx5Dhr9e2Z9MBAIAH3rEFAADQJ+zEAAAAfcJODAAA0CfsxAAAAH3CTgwAANAn7MQAAAB9wk4MAADQJ+zEAAAAfSIi/w+1grIikNF0MwAAAABJRU5ErkJggg==" alt="" />

MYSQL数据库学习十 单表数据记录查询的更多相关文章

  1. MYSQL数据库学习十一 多表数据记录查询

    11.1 关系数据操作 并(UNION):把具有相同字段数目和字段类型的表合并到一起. 笛卡尔积(CARTESIAN PRODUCT):没有连接条件表关系的返回结果.字段数=table1字段数+tab ...

  2. MySQL多表数据记录查询详解

    在实际应用中,经常需要实现在一个查询语句中显示多张表的数据,这就是所谓的多表数据记录连接查询,简称来年将诶查询. 在具体实现连接查询操作时,首先将两个或两个以上的表按照某个条件连接起来,然后再查询到所 ...

  3. Mysql-多表数据记录查询

    多表数据记录查询 一.关系数据操作 并(UNION) 并就是把具有相同字段数目和字段类型的表合并到一起 笛卡尔积(CARTESIAN PRODUCT) 笛卡尔积就是没有连接条件表关系返回的结果. 内连 ...

  4. Mysql--单表数据记录查询

    1.简单数据记录查询 1.1 简单数据查询 1.1.1 查询所有字段数据 例子:      1.1.2 "*"符号的使用 语法: 例子: 1.1.3 查询指定字段数据 例子:   ...

  5. MySQL数据库实验:任务二 表数据的插入、修改及删除

    目录 任务二 表数据的插入.修改及删除 一.利用界面工具插入数据 二.数据更新 (一)利用MySQL命令行窗口更新数据 (二)利用Navicat for MySQL客户端工具更新数据 三.数据库的备份 ...

  6. MySQL数据库篇之单表查询

    主要内容: 一.单表查询的语法 二.关键字的执行优先级 三.简单查询 四.where约束 五.分组查询 group by 六.having过滤 七.查询排序 order by 八.限制查询的记录数 l ...

  7. MYSQL数据库学习十八 数据库维护和性能提高

    18.1 数据备份 可能造成数据损失的原因有: 存储介质故障:保存数据库文件的磁盘设备损坏,用户没有数据库备份导致数据彻底丢失. 用户的错误操作:如误删了某些重要数据,甚至整个数据库. 服务器的彻底瘫 ...

  8. MYSQL数据库学习十六 安全性机制

    16.1 MYSQL数据库所提供的权限 16.1.1 系统表 mysql.user 1. 用户字段 Host:主机名: User:用户名: Password:密码. 2. 权限字段 以“_priv”字 ...

  9. MYSQL数据库学习十五 事务

    15.1 事务概述 当多个用户访问同一份数据,一个用户在更改数据的过程中可能有其他用户同时发起更改请求,为保证数据库记录的更新从一个一致性状态变为另一个一致性状态,使用事务处理是非常必要的. 事务有以 ...

随机推荐

  1. linux dns搭建

    DNS:域名解析(Domain Nmae System)正向解析:根据主机名称(域名)查找其对应的ip地址,这是最基本,最常用的功能反向解析:根据ip地址查找其对应的主机名称(域名),反垃圾邮件/安全 ...

  2. Vue项目搭建及原理一

    一. Vue简介 Vue简介 Vue是近两年来比较火的一个前端框架(渐进式框架),与reactjs和angularjs三国鼎立,根据不完全统计,包括饿了么.稀土掘金.苏宁易购.美团.天猫.荔枝FM.房 ...

  3. 编译、裁剪、安装、删除 Ubuntu内核和模块管理

    一.下载最新内核文件 地址:http://www.kernel.org,一般下载Full Source版本. 下载完毕后,放到任意文件夹中,使用命令: tar jxvf linux-x.x.x.tar ...

  4. R︱sparkR的安装与使用、函数尝试笔记、一些案例

    本节内容转载于博客: wa2003 spark是一个我迟早要攻克的内容呀~ ------------------------------------- 一.SparkR 1.4.0 的安装及使用 1. ...

  5. Ubutu Chrome 出现adobe flash is out of date的解决方法

    我们需要到官网下载flash player,网址:https://get.adobe.com/flashplayer/ 不过这里要说明一下: 一般的浏览器使用的是npapi,即adobe flash ...

  6. CSS3之background-clip

    1.属性简介 background-clip:padding|border|content|text|!important 2.兼容性 (1)IE6.7.8不兼容 (2)火狐3.0以上兼容 (3)Ch ...

  7. “var arr = []; ”和 “var arr = {};” 的区别

    1.面试题    var arr = [];    var arr = {};    比较上述代码有什么区别? 2.解析    var arr = [];是一个数组对象    var arr = {} ...

  8. 表格布局----基于bootstrap样式 布局

    在实际开发中,我们通过菜鸟教程复制的表格往往不能满足我们的开发需求,样式很难看,而且不能自适应,尤其是需要到处Excel的样式,感觉非常糟糕,这次我就写了一个表单,不足之处,希望大神们多多指教: 代码 ...

  9. java用Kruskal实现最小生成树

    今天更新这篇文章超级激动,因为我会最小生成树的算法了(其实昨天就开始研究了,只是昨天参加牛客网的算法比赛,结果又被虐了,好难过~) 最小生成树的算法,其实学了数据结构就会有一定的基础,Kruskal算 ...

  10. 微信小程序hidden

    首先hidden默认在display:block;情况下是会默认生效的: but在很多时候只在初始值下有效, 在data下声明 flag:true; 方法中: 无效,所以尽量不要使用hidden这个属 ...