04 2022 档案
摘要:
数据库关联子查询和非关联子查询 非关联子查询:数据库嵌套查询中内层查询是完全独立于外层查询的。 执行顺序: 先执行内层查询 得到内层查询的结果后带入外层,再执行外层查询 select * from tableA where tableA.column = (select tableB.column
阅读全文

摘要:
聚集函数count max min sum avgcount(*)会统计null行,count列名则不会 分组group by 过滤分组havingwhere能做的having都能做,并且where不能使用聚集函数,但是having能够使用
阅读全文

摘要:
函数:切记函数和括号要紧密相连内置函数1.算术函数abs mod roundmax min avg sum count 这几个为聚集函数,特别在分组中常用 select abs(-1); select mod(101,2); select round(37.25,1); 2.字符串函数 concat
阅读全文

摘要:
where1.比较运算符2.连接多个where语句 逻辑运算符 AND OR IN NOT 记得使用括号3.通配符 like ‘% _’ %为0-n _至少至少匹配一个 例一:in函数的使用使用DATE将字段转为日期类型 SELECT name, role_main, role_assist, hp
阅读全文

摘要:
查询列select COLUMN_NAME from TAB起别名select name as n from heros;常量select '常值' as platform ,123 as nums,name from heros;去重复行select distinct attack_range f
阅读全文

摘要:
删表 drop table if exists player; 创表create table TAB (字段 类型(长度) 说明) CREATE TABLE `player` ( `player_id` int NOT NULL, `team_id` int NOT NULL, `player_na
阅读全文

摘要:
MySQL 是典型的 C/S 架构,服务端使用mysqld 1.查找缓存-mysql8没有,mysql5是当更新表之后就清空缓存,所以适合静态表2.解析器-解析sql语句3.优化器-使用那个索引?join时表的连接顺序4.执行器-权限查询 存储引擎使用插件形式 查询query时间 1.使用selec
阅读全文
