-- 数据的准备 -- 创建一个数据库 create database python_test charset=utf8; -- 使用一个数据库 use python_test; -- 显示使用的当前数据是哪个? select database(); -- 创建一个数据表 -- students表 create table students( id int unsigned primary key auto_increment not null, name ) default '', age ,…
全部章节   >>>> 本章目录 6.1 sum.max 和 min 聚合函数 6.1.1 聚合函数介绍 6.1.2 sum 函数 6.1.3 max/min 函数 6.2 avg 和 count 函数 6.2.1 avg 函数 6.2.2 count 函数 6.3 分组查询 group by 子句 6.3.1 group by 子句 6.3.2 创建分组 6.3.3 比较 order by 和 group by 6.3.4 使用 where 子句实现分组之前过滤数据 6.3.5…
接上篇:Mybatis环境搭建 在搭建环境时已经有了mapper和sqlMapConfig 1,数据库建表 prompt PL/SQL Developer import file prompt Created on 2018年6月1日 by Administrator set feedback off set define off prompt Creating T_USER... create table T_USER ( T_NAME ) not null, T_PASS ), T_ID )…
T-SQL简单查询语句 简单查询: 1.最简单查询(查所有数据) select * from 表名: 注:* 代表所有列 select * from info 2.查询指定列 select code,name from info 3.修改结果集的列名 select code as '代号',name as '姓名' from info 4.条件查询 select * from info where code='p003' 5.多条件查询 查询info表中code为p003或者nation为n00…
1.where 条件过滤 常见的表达式过滤:比如: select * from 表 where Id>10; 多条件过滤: and or not    (优先级:not > and > or)       !  &&     || select * from SalesLT.Customer where CustomerID and Title<>'MS.' or MiddleName='N.' --<>非的意思 先运算 <>, 再运算…
分组查询: https://www.cnblogs.com/netserver/p/4518995.html 日期格式化格式: http://blog.csdn.net/qq_16769857/article/details/52289627 日期和字符串之间的转换: https://www.cnblogs.com/windphoenix/archive/2013/04/26/3044784.html 日期的模糊查询: https://zhidao.baidu.com/question/5071…
public function index() { //return Member::getMember();//这是调用模型的方法 return view('lpc',[ 'age'=>18, 'name'=>'PengchongLee', ]); } public function test()//一个方法得设置一个路由 { //echo 1;//测试路由 //新增数据 //$data = DB::insert('insert into test(name,age) values(?,?)…
use StudentManageDB go select StudentName,StudentAddress from Students where StudentAddress like '天津%' select StudentName,StudentAddress from Students where StudentName like '%小%' select * from ScoreList select StudentName,StudentAddress,Birthday fro…
分组函数(聚合函数) 1.count(*/列名): a.*:求出该数据的总条数 select  count(*)  from 表名 b.列名:求出该列中列名不为null的总条数 select  count(列名)  from 表名 2.sum(列名):求出该列所有数据的累加之和 select sum(列名) from 表名 3.avg(列名):求出该列的平均值 select avg(列名) from 表名 4.max(列名):求出该列的最大值 select max(列名) from 表名 5.m…
聚合函数 (常用) 函数名称 描述 CONUT() 记数 SUM() 求和 AVG() 平均值 MAX() 最大值 MIN() 最小值 -- ================= 聚合函数 =============== -- 都能统计表中的数据 SELECT COUNT(`subject`) FROM `subject` -- count(字段) 会忽略所有的 null 值 SELECT COUNT(*) FROM `subject` -- count(*) 不会忽略 null 值, 本质是计算…