
sql
布小昕
梦想开始的地方,她在等你。
展开
-
Mysql中json格式数据查询、修改
针对Mysql存储的json格式数据进行查询、修改分享原创 2022-07-06 16:28:14 · 4738 阅读 · 1 评论 -
mysql通过一个表更新另一个表数据
更新student_test表年龄字段为空的数据: update student_test br set age= (select age from student where name = br.name) where age is null;原创 2021-10-25 15:04:10 · 3300 阅读 · 0 评论 -
A,B两表,找到ID字段中,存在A表,但不存在B表的数据。
A,B两表,找到ID字段中,存在A表,但不存在B表的数据。 A表共13w,去重后3w B表共2W,且有索引 方法一:not in,易理解,效率低,时间:1.395s select distinct A.id from A where A.id not in(select id from B) 方法二:left...join...on ,B.id isnull 时间:0.739s select A.ID from A left join B on A.ID=B.ID where B.ID..原创 2020-12-22 11:31:30 · 355 阅读 · 0 评论 -
sql经典练习题
表结构 DROP DATABASE IF EXISTS test1; CREATE DATABASE test1; USE test1; ##部门表 #DROP IF EXISTS TABLE DEPT; CREATE TABLE DEPT( DEPTNO int PRIMARY KEY,##部门编号 DNAME VARCHAR(14) , ##部门名称 LOC VARCHAR(13) ##部门地址 ) ; INSERT INTO DEPT VALUES (10,'AC...原创 2020-12-21 15:07:07 · 273 阅读 · 0 评论