jjdhfbu
jjdhfbu
全部文章
分类
归档
标签
去牛客网
登录
/
注册
jjdhfbu的博客
全部文章
(共44篇)
题解 | #返回顾客名称和相关订单号#
select cust_name,order_num from Customers inner join Orders on Customers.cust_id = Orders.cust_id #group by cust_name order by cust_name,order_num
2023-03-28
5
626
题解 | #计算总和#
select order_num, sum(item_price*quantity) as total_price from OrderItems group by order_num having total_price>=1000 order by order_num
2023-03-28
0
250
题解 | #返回订单数量总和不小于100的所有订单的订单号#
select order_num from OrderItems group by order_num having sum(quantity)>=100 order by order_num count()和sum()的区别注意区分:count():汇总,但是汇总属性总数即你出现几次就cou...
2023-03-28
0
331
题解 | #每个供应商成本最低的产品#
select vend_id, min(prod_price) as cheapest_item from Products group by vend_id order by cheapest_item
2023-03-28
0
202
题解 | #返回每个订单号各有多少行数#
select order_num, count(order_num) as order_lines from OrderItems group by order_num order by order_lines 对统计数据进行条件输出,需要先将order_num分组,才能分组统计成功
2023-03-28
0
266
题解 | #返回 2020 年 1 月的所有订单的订单号#
select order_num,order_date from Orders where year(order_date)=2020 and month(order_date)=01 order by order_date
2023-03-27
0
211
题解 | #21年8月份练题总数#
SELECT count(distinct device_id) as did_cnt, count(question_id) as question_cnt from question_practice_detail where year(date) = 2021 and month(date) ...
2023-03-26
0
207
题解 | #浙大不同难度题目的正确率#
select qd.difficult_level, sum(if(qpd.result="right",1,0))/count(qpd.question_id) as correct_rate from question_practice_detail as qpd left join user...
2023-03-26
0
309
题解 | #截取出年龄#
#俄罗斯套娃式截取 select substring_index(substring_index(profile,",",3),",",-1) as age, count(*) as number from user_submit group by age
2023-03-26
0
259
题解 | #提取博客URL中的用户名#
select device_id, substring_index(blog_url,"/",-1) as user_name from user_submit
2023-03-26
7
820
首页
上一页
1
2
3
4
5
下一页
末页