牛客987852806号
牛客987852806号
全部文章
分类
题解(45)
归档
标签
去牛客网
登录
/
注册
牛客987852806号的博客
全部文章
(共163篇)
题解 | #分析访客浏览行为#
这道题是考去重的,去重有几种方式1.distinct 列名直接去重 2.group by 分组去重 第一组 distinct 去重 select 访客id,浏览日期 from 用户行为表 group by 访客id,浏览日期 第二组 group by 去重 select 访客id,浏览日期 fro...
2024-06-28
0
173
题解 | #查找空值#
基础的select 列名,列名 from 表名 where 条件null 比较特殊,要用 is null 含null,或者 is not null 不含null select 教师号, 教师姓名 from 教师表 where 教师姓名 is null
2024-06-28
0
168
题解 | #查找非空值#
select 教师号, 教师姓名 from 教师表 where 教师姓名 is not null 基础的select 列名,列名 from 表名 where 条件null 比较特殊,要用 is null 含null,或者 is not null 不含null
2024-06-28
0
203
题解 | #得分不小于平均分的最低分#
select min(t.score) as min_score_over_avg from( select ed.exam_id,score, avg(score)over(partition by exam_id) as pg from exam_record ed left join ex...
2024-06-11
0
183
题解 | #实习广场投递简历分析(三)#
with tiaojian as ( select job, date_format(date,"%Y-%m") as month, month(date) as com, sum(num) as cnt from resume_info where year(date)=2...
2024-03-26
1
240
题解 | #有取消订单记录的司机平均评分#
#小白好理解的写法 with tiaojian as ( select driver_id from tb_get_car_order //求出有取消记录的司机 where start_time is null and date_format(order_time,"...
2024-03-21
1
209
题解 | #连续签到领金币#
#小白另类解法,好理解,请大牛多多指教 with tiaojian as ( select uid, artical_id, date(in_time) as day, lead(date(in_time),1)over(partition by uid order by date(in_time)...
2024-03-20
1
262
题解 | #每天的日活数及新用户占比#
#简单的判断思路解题,排序判断uid排名第一的登录的时间,再利用case进行判断 with tiaojian as ( select uid, date(in_time) as day from tb_user_log group by uid,day union all select uid, ...
2024-03-20
1
230
题解 | #统计活跃间隔对用户分级结果#
#比较好理解的解法 with tiaojian as ( select uid, min(date(in_time))over(partition by uid order by date(in_time)) as first_date, max(date(in_time))over(partiti...
2024-03-20
1
230
题解 | #2021年11月每天新用户的次日留存率#
#小白新思路,好理解,利用窗口函数直接求出结果。 #1.先合并表,因题目说了离开日期为第二天也算隔天登录。 #2.先找到第一次登录时间,因按照天计算,可以形成1天多次登录,第一天多次登录都算第一次登录时间。 #3.利用lead()求出下次登录时间,因要求次日留存率,故需要。 #4.筛出2021年11...
2024-03-20
0
215
首页
上一页
3
4
5
6
7
8
9
10
11
12
下一页
末页