HAsuka
HAsuka
全部文章
题解
归档
标签
去牛客网
登录
/
注册
HAsuka的博客
全部文章
/ 题解
(共19篇)
题解 | #牛客的课程订单分析(七)#
mysql无敌套中套:select (case when a.is_group_buy = 'yes' then 'GroupBuy'else c.name end) t,count(case when a.is_group_buy = 'yes' then 'GroupBuy'else c.nam...
2021-06-03
0
504
题解 | #牛客的课程订单分析(六)#
select a.id,a.is_group_buy,c.name from order_info ajoin(select user_id from order_infowhere date > '2025-10-15'and product_name in ('C++','Java','P...
2021-06-03
0
440
题解 | #牛客的课程订单分析(四)#
mysql套中套,挺突然的解法:select s.user_id,t.yy,t.gg from order_info s,(select user_id,min(date) yy,count(*) gg from order_infowhere product_name in ('C++','Jav...
2021-06-02
0
575
题解 | #牛客的课程订单分析(三)#
mysql套中套语句:select s.* from order_info s,(select user_id,count(*) as gg from order_infowhere product_name in ('C++','Java','Python')and date>'2025-1...
2021-06-02
0
468
题解 | #牛客每个人最近的登录日期(四)#
左连接进行判断:select a.date,count(b.date)from login aleft join (select id,min(date) date from login group by user_id) bon a.id=b.idgroup by a.date
2021-06-01
0
530
题解 | #牛客每个人最近的登录日期(二)#
采用子查询查询出牛客最近登录的个人id和时间,再去做设备匹配:select b.name,c.name,a.date from login ajoin user b on a.user_id = b.idjoin client c on a.client_id = c.idwhere (a.user...
2021-06-01
0
439
题解 | #获取有奖金的员工相关信息。#
select a.emp_no,a.first_name,a.last_name,b.btype,c.salary,(casewhen b.btype = 1 then c.salary * 0.1when b.btype = 2 then c.salary * 0.2else c.salary *...
2021-06-01
0
428
题解 | #将employees表中的所有员工的last_name和first_name通过引号连接起来。#
mysql语句:(用\转义字符)select concat(last_name,''',first_name)from employeessqlite语句:select (last_name||"'"||first_name)from employees
2021-06-01
1
588
题解 | #将id=5以及emp_no=10001的行数据替换成id=5以及emp_no=10005#
表更新语句结构 UPDATE 表名 SET 字段 = REPLACE(字段,原值,变值) WHERE 过滤条件 update titles_test set emp_no = replace(emp_no,10001,10005) where id = 5
2021-06-01
0
526
题解 | #针对上面的salaries表emp_no字段创建索引idx_emp_no#
sqlite语句:select *from salariesindexed by idx_emp_nowhere emp_no=10005; mysql语句:select *from salariesforce index (idx_emp_no)where emp_no=10005;
2021-06-01
0
418
首页
上一页
1
2
下一页
末页