首页
题库
公司真题
专项练习
面试题库
在线编程
面试
面试经验
AI 模拟面试
简历
求职
学习
基础学习课
实战项目课
求职辅导课
专栏&文章
竞赛
我要招人
发布职位
发布职位、邀约牛人
更多企业解决方案
AI面试、笔试、校招、雇品
HR免费试用AI面试
最新面试提效必备
登录
/
注册
景辞
获赞
6
粉丝
0
关注
0
看过 TA
0
南阳师范学院
2025
IP属地:河南
暂未填写个人简介
私信
关注
拉黑
举报
举报
确定要拉黑景辞吗?
发布(59)
评论
刷题
收藏
景辞
关注TA,不错过内容更新
关注
2024-05-27 20:58
南阳师范学院
题解 | #返回产品并且按照价格排序#
select prod_name,prod_pricefrom Productswhere prod_price between 3 and 6order by prod_price;
0
点赞
评论
收藏
分享
2024-05-27 20:56
南阳师范学院
题解 | #返回更高价格的产品#
select prod_id,prod_namefrom Products where prod_price>=9;
0
点赞
评论
收藏
分享
2024-05-27 19:41
南阳师范学院
题解 | #日活与每日次日留存率#
with t1 as(select *,lead(visit_date,1) over(partition by id order by visit_date) next_date from user_visit_log)select visit_date, count(distinct id) dau,sum(if(datediff(next_date,visit_date)=1,1,0))/count(distinct id) next_day_perfrom t1group by visit_date;
0
点赞
评论
收藏
分享
2024-05-27 19:24
南阳师范学院
题解 | #评论替换和去除#
select id,replace(comment,',','') commentfrom comment_detailwhere char_length(comment)>3 ;
0
点赞
评论
收藏
分享
2024-05-27 19:01
南阳师范学院
题解 | #话题的分布情况#
select substring_index(substring_index(subject_set,',',2),',',1)subject_id1,count(subject_set) cntfrom comment_detailwhere substring_index(substring_index(subject_set,',',2),',',-1) ='1002'group by subject_id1;
0
点赞
评论
收藏
分享
2024-05-27 18:45
南阳师范学院
题解 | #字符函数正则匹配2#
select id,commentfrom comment_detailwhere comment like '是%' or comment like '求%';
0
点赞
评论
收藏
分享
2024-05-27 18:36
南阳师范学院
题解 | #输出在5min内完成点击购买的用户ID#
select user_ad_click_time.user_id uidfrom user_ad_click_time,user_payment_timewhere user_ad_click_time.user_id=user_payment_time.user_id and (date(pay_time-click_time)*24*60+hour(pay_time-click_time)*60+minute(pay_time-click_time)+second(pay_time-click_time)/60)<5order by user_ad_click_time.user_...
0
点赞
评论
收藏
分享
2024-05-27 18:28
南阳师范学院
题解 | #广告点击的高峰期#
select hour(click_time) click_hour,count(hour(click_time) ) click_cntfrom user_ad_click_timegroup by hour(click_time) order by count(hour(click_time)) desclimit 1;
0
点赞
评论
收藏
分享
2024-05-27 08:59
南阳师范学院
题解 | #输出提交且通过次数大于2 的用户ID且升序排列#
select user_idfrom done_questions_recordwhere question_id>=1group by user_idhaving sum(result_info)>2;
0
点赞
评论
收藏
分享
2024-05-27 08:57
南阳师范学院
题解 | #输出提交次数大于2次的用户ID且倒序排列#
select user_id from done_questions_recordgroup by user_idhaving count(done_time)>2order by user_id desc;
0
点赞
评论
收藏
分享
2024-05-27 08:55
南阳师范学院
题解 | #查询用户刷题日期和下一次刷题日期#
select user_id,date,lead(date,1) over(partition by user_id order by date ) as nextdate from questions_pass_record;
0
点赞
评论
收藏
分享
2024-05-26 21:59
南阳师范学院
题解 | #查询每天刷题通过数最多的前二名用户id和刷题数#
先用窗口函数求出每天答题情况,并按照通过数降序排列,之后筛选出排名小于等于2的就是所求答案select date, user_id,pass_count from(select *,row_number() over(partition by date order by pass_count desc) rn from questions_pass_record) as tempwhere rn<=2;
0
点赞
评论
收藏
分享
2024-05-26 21:39
南阳师范学院
题解 | #分群并计算群体人数#
with t1 as(select case when age<20 then '20以下'when age between 20 and 50 then '20-50'when age >50 then '50以上'else '未填写'end age_groupfrom customers_info)select age_group,count(age_group) user_countfrom t1group by age_group;
0
点赞
评论
收藏
分享
2024-05-26 21:25
南阳师范学院
题解 | #请按城市对客户进行排序,城市为空,按国家排序#
因为order by排序会把空值放在一起,所以按照第一个字段进行排序过后,空值会在一起,之后根据第二个字段排序,所以不用使用case when进行情况判断,直接写order by语句即可select * from customers_infoorder by city,country;
0
点赞
评论
收藏
分享
2024-05-26 21:17
南阳师范学院
题解 | #判断其是否有过购买记录#
用case when 解决select customer_id,casewhen latest_place_order_date is not null then 1when latest_place_order_date is null then 0end if_placed_orderfrom customers_info;
0
点赞
评论
收藏
分享
1
2
3
4
创作者周榜
更多
关注他的用户也关注了:
牛客网
牛客网在线编程
牛客网题解
牛客企业服务