排名

用户解题统计

过去一年提交了

勋章 ①金银铜:在竞赛中获得第一二三名;②好习惯:自然月10天提交;③里程碑:解决1/2/5/10/20/50/100/200题;④每周打卡挑战:完成每周5题,每年1月1日清零。

收藏

收藏日期 题目名称 解决状态
2026-01-03 分类(1)姿势太多很过分,分类要用CaseWhen  已解决

评论笔记

评论日期 题目名称 评论内容 站长评论
没有评论过的题目。

提交记录

提交日期 题目名称 提交代码
2026-01-05 表连接(1)你们难道都去过?那就试试用InnerJoin 
select
mch_nm
from cmb_usr_trx_rcd
where usr_id in ('5201314520', '5211314521') and year(trx_time) = 2024
group by mch_nm
having count(usr_id) = 2
order by mch_nm
2026-01-05 表连接(1)你们难道都去过?那就试试用InnerJoin 
select
mch_nm
from cmb_usr_trx_rcd
where usr_id in ('5201314520', '5211314521') and year(trx_time) = 2024
group by mch_nm
having count(usr_id) = 2
2026-01-05 接收红包金额绿茶榜 
select
rcv_usr_id,
sum(pkt_amt) as sum_trx_amt
from tx_red_pkt_rcd
group by rcv_usr_id
order by sum_trx_amt desc
limit 10;
2026-01-05 红包金额土豪榜 
select
snd_usr_id,
sum(pkt_amt) as sum_trx_amt
from tx_red_pkt_rcd
group by snd_usr_id
order by sum_trx_amt desc
limit 10;
2026-01-05 基础标量子查询-带分组 
select
usr_id,
sum(trx_amt) as total_amt,
(select avg(trx_amt) from cmb_usr_trx_rcd) as platform_avg_amt
from cmb_usr_trx_rcd
group by usr_id
order by total_amt desc;
2026-01-05 WHERE子查询 + 比较运算符 
select *
from cmb_usr_trx_rcd
where trx_amt > (select avg(trx_amt) from cmb_usr_trx_rcd)
order by trx_amt desc
2026-01-05 GROUP BY-各科目平均分 
select 
subject,
avg(score) as average_score
from scores
where exam_date = '2024-06-30'
group by subject
order by subject asc;
2026-01-05 销售金额前10的商品信息 
select 
goods_id,
sum(order_gmv) as total_gmv
from order_info
where date(order_time) = '2024-09-10'
group by goods_id
order by sum(order_gmv) desc
limit 10
2026-01-04 字符串与通配符(1)名称里面有特服,可以使用通配符 
select 
count(distinct(mch_nm)) as mch_cnt
from cmb_usr_trx_rcd 
where mch_nm like '%按摩保健休闲%'
2026-01-04 字符串与通配符(1)名称里面有特服,可以使用通配符 
select 
count(mch_nm) as mch_cnt
from cmb_usr_trx_rcd 
where mch_nm like '%按摩保健休闲%'
2026-01-03 分类(1)姿势太多很过分,分类要用CaseWhen 
select
case when trx_amt=288 then '1.WithHand'
 when trx_amt=388 then '2.WithMimi'
 when trx_amt=588 then '3.BlowJobbie'
 when trx_amt=888 then '4.Doi'
 when trx_amt=1288 then '5.DoubleFly'
else '6.other'
end as ser_typ,
count(usr_id) as trx_cnt,
min(date(trx_time)) as first_date
from cmb_usr_trx_rcd
where usr_id='5201314520' and mch_nm = '红玫瑰按摩保健休闲'
group by ser_typ
order by ser_typ
2026-01-03 分类(1)姿势太多很过分,分类要用CaseWhen 
select
case when trx_amt=288 then '1.WithHand'
 when trx_amt=388 then '2.WithMimi'
 when trx_amt=588 then '3.BlowJobbie'
 when trx_amt=888 then '4.Doi'
 when trx_amt=1288 then '5.DoubleFly'
else '6.other'
end as ser_typ,
count(trx_amt) as trx_cnt,
min(date(trx_time)) as first_date
from cmb_usr_trx_rcd
where usr_id='5201314520' and mch_nm = '红玫瑰按摩保健休闲'
group by ser_typ
order by ser_typ
2026-01-03 分类(1)姿势太多很过分,分类要用CaseWhen 
select 
case when trx_amt=288 then '1.WithHand'
when trx_amt=388 then '2.WithMimi'
when trx_amt=588 then '3.BlowJobbie'
when trx_amt=888 then '4.Doi'
when trx_amt=1288 then '5.DoubleFly'
else '6.other'
end as ser_typ
,count(usr_id) as trx_cnt
,min(date(trx_time)) as first_date
from cmb_usr_trx_rcd
where mch_nm = '红玫瑰按摩保健休闲'
and usr_id='5201314520'
group by trx_amt
order by ser_typ
2026-01-03 分类(1)姿势太多很过分,分类要用CaseWhen 
select 
case when trx_amt=288 then '1.WithHand'
when trx_amt=388 then '2.WithMimi'
when trx_amt=588 then '3.BlowJobbie'
when trx_amt=888 then '4.Doi'
when trx_amt=1288 then '5.DoubleFly'
else '6.others'
end as ser_typ
,count(usr_id) as trx_cnt
,min(date(trx_time)) as first_date
from cmb_usr_trx_rcd
where mch_nm = '红玫瑰按摩保健休闲'
and usr_id='5201314520'
group by trx_amt
order by ser_typ
2026-01-03 分类(1)姿势太多很过分,分类要用CaseWhen 
select 
case when trx_amt= 288 then '1.WithHand'
when trx_amt= 388 then '2.WithMimi'
when trx_amt= 588 then '3.BlowJobbie'
when trx_amt= 888 then '4.Doi'
when trx_amt= 1288 then '5.DoubleFly'
else '6.others'
end as ser_typ
,count(usr_id) as trx_cnt
,min(date(trx_time)) as first_date
from cmb_usr_trx_rcd
where mch_nm = '红玫瑰按摩保健休闲'
and usr_id='5201314520'
group by trx_amt
order by ser_typ
2026-01-03 分类(1)姿势太多很过分,分类要用CaseWhen 
select 
case when trx_amt= 288 then '1.WithHand'
when trx_amt= 388 then '2.WithMimi'
when trx_amt= 588 then '3.BlowJobbie'
when trx_amt= 888 then '4.Doi'
when trx_amt= 1288 then '5.DoubleFly'
else '6.others'
end as ser_typ
,count(usr_id) as trx_cnt
,min(date(trx_time)) as first_date
from cmb_usr_trx_rcd
where mch_nm = '红玫瑰按摩保健休闲'
and usr_id='5201314520'
group by ser_typ
order by 1
2026-01-03 分类(1)姿势太多很过分,分类要用CaseWhen 
select 
case when trx_amt= 288 then '1.WithHand'
when trx_amt= 388 then '2.WithMimi'
when trx_amt= 588 then '3.BlowJobbie'
when trx_amt= 888 then '4.Doi'
when trx_amt= 1288 then '5.DoubleFly'
else '6.others'
end as ser_typ
,count(usr_id) as trx_cnt
,min(date(trx_time)) as first_date
from cmb_usr_trx_rcd
where mch_nm = '红玫瑰按摩保健休闲'
and usr_id='5201314520'
group by ser_typ
order by ser_typ
2025-12-31 聚合函数-比较两位同学的数学成绩 
select
student_id,
max(score) as max_score,
min(score) as min_score,
avg(score) as avg_score
from scores
where 
student_id in ('460093', '735011')
and subject = '数学'
group by
student_id
2025-12-31 聚合函数-735011学生的语文成绩 
select 
max(score) as max_score,
min(score) as min_score,
avg(score) as avg_score
from scores
where student_id = '735011'
and subject = '语文'
2025-12-31 聚合函数-735011学生的语文成绩 
select 
student_id,
subject,
max(score) as max_score,
min(score) as min_score,
avg(score) as avg_score
from scores
where student_id = '735011'
and subject = '语文'