上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 94 下一页
摘要: 简介 select user.id, user.name,t.grade_sum from ( select user_id,sum(grade_num) as grade_sum from grade_info group by user_id having grade_sum = ( selec 阅读全文
posted @ 2021-07-01 16:17 HDU李少帅 阅读(117) 评论(1) 推荐(0) 编辑
摘要: 简介 联表查询, 相当于 inner join? 不是 因为不能用on select a.id, a.number, count(distinct b.number) as t_rank from passing_number as a, passing_number as b where a.nu 阅读全文
posted @ 2021-07-01 15:54 HDU李少帅 阅读(55) 评论(0) 推荐(0) 编辑
摘要: 简介 第二个select一定要起一个别名,否则会出错 注意子查询 select a.id, a.job, a.score from grade as a left join ( select job, avg(c.score) as score from grade as c group by c. 阅读全文
posted @ 2021-07-01 15:53 HDU李少帅 阅读(28) 评论(0) 推荐(0) 编辑
摘要: 简介 select user_id from ( select id, user_id, product_name, status, client_id, date, count(1) over (partition by user_id) as num from order_info where 阅读全文
posted @ 2021-07-01 15:08 HDU李少帅 阅读(51) 评论(0) 推荐(0) 编辑
摘要: 简介 select id, user_id, product_name, status, client_id, date from ( select id, user_id, product_name, status, client_id, date, count(1) over (partitio 阅读全文
posted @ 2021-07-01 15:07 HDU李少帅 阅读(56) 评论(0) 推荐(0) 编辑
摘要: 简介 from 接 子查询 count(1) 统计个数 over (partition by user_id) 以user_id 进行分区 left join on 后面还可以加上where select a.id, a.is_group_buy, b.name as client_name fro 阅读全文
posted @ 2021-07-01 14:53 HDU李少帅 阅读(47) 评论(0) 推荐(0) 编辑
摘要: 简介 考察DATE_FORMAT 与 group 联立 order by 联立 select job, DATE_FORMAT(date, '%Y-%m') as mon, sum(num) as cnt from resume_info where date like '2025%' group 阅读全文
posted @ 2021-07-01 12:00 HDU李少帅 阅读(49) 评论(0) 推荐(0) 编辑
摘要: 简介 考察 over 从一行到另一行?? 先暂时这么记忆吧 select grade, sum(number) over(order by grade) t_rank from class_grade order by grade; 阅读全文
posted @ 2021-07-01 11:51 HDU李少帅 阅读(34) 评论(0) 推荐(0) 编辑
摘要: 简介 select concat(last_name, ' ', first_name) as Name from employees; 阅读全文
posted @ 2021-07-01 11:40 HDU李少帅 阅读(104) 评论(0) 推荐(0) 编辑
摘要: 简介 INSERT INTO actor values (1, 'PENELOPE', 'GUINESS', '2006-02-15 12:34:33'), (2, 'NICK', 'WAHLBERG', '2006-02-15 12:34:33') 阅读全文
posted @ 2021-07-01 11:38 HDU李少帅 阅读(38) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 94 下一页