08 2021 档案

摘要:知识点 sum(cost) over(PARTITION BY NAME ORDER BY p_date ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS sample4,--和sample3一样,由起点到当前行的聚合 sum(cost) ov 阅读全文
posted @ 2021-08-12 18:12 luckie 阅读(226) 评论(0) 推荐(0)
摘要:方法一:自连接(我自己想到的) # select a.employee_id # from Employees a # left join Employees b # on a.manager_id=b.employee_id # left join Employees c # on b.manag 阅读全文
posted @ 2021-08-10 16:24 luckie 阅读(352) 评论(0) 推荐(0)
摘要:方法一:我自己写的 # with t as # ( # select * # ,case when host_goals>guest_goals then 3 when host_goals=guest_goals then 1 else 0 end as host_score, # case wh 阅读全文
posted @ 2021-08-09 16:35 luckie 阅读(208) 评论(0) 推荐(0)
摘要:方法一 select round(sum(case when order_date=customer_pref_delivery_date then 1 else 0 end)/count(*)*100,2) immediate_percentage from Delivery; 方法二 selec 阅读全文
posted @ 2021-08-04 16:22 luckie 阅读(553) 评论(0) 推荐(0)