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
阅读全文
摘要:方法一:自连接(我自己想到的) # 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
阅读全文
摘要:方法一:我自己写的 # 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
阅读全文
摘要:方法一 select round(sum(case when order_date=customer_pref_delivery_date then 1 else 0 end)/count(*)*100,2) immediate_percentage from Delivery; 方法二 selec
阅读全文

浙公网安备 33010602011771号