最新 最热

Leetcode 601. 体育馆的人流量(lag 和head 函数)

select id,visit_date,people from( select *, lag(people,1) over(order by id)l1, lag(people,2)over(order by id) l2, lead(peopl...

2021-04-20
0

Leetcode 597. 好友申请 I:总体通过率(round,计数)

select round( ifnull( 1/(count( distinct f1.sender_id,f1.send_to_id) /count(distinct r1.requester_id,r1...

2021-04-20
0

Leetcode 596. 超过5名学生的课(group by + having

select class from courses group by 1 having count(distinct student)>=5

2021-04-20
0

程序员绝对是一个容易发胖的职业!程序员的自我修养:控制体重多运动

程序员不能跑着写代码,工作量一多,就要久坐。遇到难写的代码,大脑就要消耗很多能量,为了维持大脑运转,就需要摄入含糖量高的甜食,快速恢复血糖。再加上赶进度,加班熬夜吃夜宵,更加促进了体重的增长。...

2021-04-16
0

Leetcode. 1294. 不同国家的天气类型(非常经典的order by +where限制分组查询)

select c.country_name, case when avg(w.weather_state)<=15 then "Cold" when avg(w.weather_state)<25 then "Warm" else "Hot" end weather_type...

2021-04-16
0

Leetcode 595. 大的国家

select name,population,area from world where area>3000000 or population>25000000

2021-04-15
0

Leetcode 586. 订单最多的客户

select customer_number from orders group by 1 order by count(*) desclimit 0,1

2021-04-15
0

Leetcode 585. 2016年的投资 (partion by 的经典使用)

select round(sum(tiv_2016),2) tiv_2016 from (select *,count(*) over(partition by tiv_2015) a1,count(*) over(partition by lat,lon) a2 from insurance) as...

2021-04-15
0

Leetcode 584. 寻找用户推荐人(水题)

select name from customer where referee_id <>2 or isnull(referee_id)

2021-04-14
0

Leetcode 580. 统计各专业学生人数(常规聚合 寻找非空字段计数)

select dept_name,count(student_id) student_number from department d left join student s on d.dept_id=s.dept_id group by dept_name order by 2 d...

2021-04-14
0