GuaMiao
GuaMiao
全部文章
分类
归档
标签
去牛客网
登录
/
注册
GuaMiao的博客
全部文章
(共92篇)
题解 | #考试分数(五)#
with t1 as ( select job, (case when MOD(count(score), 2) = 1 then CONVERT(count(score)/2, SIGNED INTEGER) else CONVERT(count(score)/2, SIGNED...
2023-08-21
0
342
题解 | #实习广场投递简历分析(三)#
# 找到2025年每月的数据 with t1 as ( select id, job, date, num, DATE_FORMAT(date, '%Y-%m') as first_year_mon from resume_info where date between '2...
2023-08-20
0
481
题解 | #获得积分最多的人(三)#
with t1 as ( select user_id, (case when type = 'add' then grade_num else -grade_num end) as grade_change from grade_info ), # 将每一个人的总积...
2023-08-20
1
342
题解 | #窗口函数三个排序函数的区别与使用
select emp_no, salary, DENSE_RANK() OVER (ORDER BY salary desc) as t_rank from salaries order by salary desc, emp_no;
2023-08-19
0
377
题解 | #汇总各个部门当前员工的title类型的分配数目#
with t1 as ( select a.emp_no, a.dept_no, b.dept_name from dept_emp as a left join departments as b on a.dept_no = b.dept_no ) select t...
2023-08-18
0
319
题解 | #牛客每个人最近的登录日期(二)#
with t1 as ( select user_id, max(date) as date from login group by user_id ), # 在这里我刚开始直接用的date in (select date from t1),这样是不对的,应该使用连接,连接的...
2023-08-18
1
495
题解 | #考试分数(四)# 考察MOD取余判断奇偶
with t1 as ( select job, count(score) as cnt from grade group by job ) select job, (case when MOD(cnt, 2) = 0 then round(cnt/2,0) else CEI...
2023-08-17
0
342
题解 | #考试分数(三)#
with t1 as ( select a.id, b.name, a.score from grade as a left join language as b on a.language_id = b.id ), # 按照name进行分组,然后按照score降序进...
2023-08-17
0
425
题解 | #月均完成试卷数不小于3的用户爱作答的类别#
# count不会将空值记录进去 # 计算月均完成试卷数,等于总完成试卷数/多少各月份 # t1先计算总的完成数量和总共占多少月份 with t1 as ( select uid, count(score) as total_cnt, count(distinct DATE...
2023-08-16
0
284
题解 | #只出现一次的牛II#python哈希表
# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # # @param nums int整型一维数组 # @return int整型一维数组 # class Solution: def findSingleCowsII(self , nums: Lis...
2023-08-15
0
288
首页
上一页
1
2
3
4
5
6
7
8
9
10
下一页
末页