三本蒟蒻痴心南软
三本蒟蒻痴心南软
全部文章
题解
归档
标签
去牛客网
登录
/
注册
三本蒟蒻痴心南软的博客
全部文章
/ 题解
(共5篇)
mysql没有Outter Join?
之前有一题说要用outter join 其实left和right join都属于outer join 且根据题目的描述,这里并不适合使用全连接(使用左连接,结果如下) select Vendors.vend_id as vend_id, count(Products.prod_id) as prod...
Mysql
2022-05-18
1
347
题解 | #返回产品名称和每一项产品的总订单数#
法一: 这种题目说实话我写的是比较蛋疼的,所以都会记录下来 先贴出来我写的代码:死活不愿意用prod_name来group by,那么就要多投影一次 select res.prod_name, res.total as orders from ( select t1.prod_id, t1.p...
Mysql
2022-05-16
0
375
问题写法+完善
问题写法 按照上题简单的写法来写的话 这题可以写出如下的sql select cust_name,sum(item_price*quantity) as total_price from Orders as t1 inner join OrderItems as t2 on t1.order_num...
Mysql
2022-05-12
12
524
题解 | #返回每个顾客不同订单的总金额#
整理一下思路 1 select cust_id, ( select sum(item_price * quantity) from OrderItems where OrderItems.order_num = Orders.order_num ) as total_ordered...
Mysql
2022-05-10
0
301
一题六解,解法收录
收集一下这题的各种解法 字符串匹配(近似查找法) 用like来查找 select order_num, order_date from Orders where order_date like '2020-01%' order by order_date 切割字符串 select order_n...
Mysql
2022-05-06
841
4293