摘要:
解法一:暴力法 class Solution(object): def maxArea(self, height): """ :type height: List[int] :rtype: int """ lst=[] l=len(height) for i in range(l-1): for j 阅读全文
摘要:
知识点 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 阅读全文
摘要:
这道题很数学,需要转个弯。 方法一:使用case when后,如果学生人数是奇数,则改变了最后一个同学的座位。这时我们需要使用窗口函数重新进行一次排序。 select row_number() over (order by new_id) id,student from ( select case 阅读全文
摘要:
方法一: select product_id,product_name from ( select a.product_id,product_name, case when sale_date<='2019-03-31' and sale_date>='2019-01-01' then 0 else 阅读全文