排名

用户解题统计

过去一年提交了

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

收藏

收藏日期 题目名称 解决状态
没有收藏的题目。

评论笔记

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

提交记录

提交日期 题目名称 提交代码
2025-03-10 时间日期(1)按月统计日花费,一天都不要浪费 
select
	Substr(trx_time,1,7),
 	last_day(max(trx_time))
from 
	cmb_usr_trx_rcd 
where 
	usr_id = 5201314520 
 	and year(trx_time) in (2023,2024)
group by Substr(trx_time,1,7)
2025-03-10 表连接(5)哪些没被分出来,用左用内你来猜 
select mch_typ,a.mch_nm,count(trx_amt),sum(trx_amt)
from 
	cmb_usr_trx_rcda 
leftjoin cmb_mch_typb
on a.mch_nm=b.mch_nm
where 
	usr_id = 5201314520 
 	and year(trx_time) = 2024
	andmch_typ is null
group by mch_typ,a.mch_nm
2025-03-10 表连接(5)哪些没被分出来,用左用内你来猜 
select mch_typ,a.mch_nm,count(trx_amt),sum(trx_amt)
from 
	cmb_usr_trx_rcda 
rightjoin cmb_mch_typb
on a.mch_nm=b.mch_nm
where 
	usr_id = 5201314520 
 	and year(trx_time) = 2024
group by mch_typ,a.mch_nm
2025-03-10 表连接(4)渣男把钱花在哪儿,维表可以来帮忙 
select mch_typ,count(trx_amt),sum(trx_amt)
from 
(select
	*
from 
	cmb_usr_trx_rcd 
where 
	usr_id = 5201314520 
 	and year(trx_time) = 2024) a 
left join (
select * from cmb_mch_typ ) b 
on a.mch_nm=b.mch_nm
group by mch_typ
2025-03-05 表连接(1)你们难道都去过?那就试试用InnerJoin 
select a.mch_nm
from 
(select distinct mch_nm
from cmb_usr_trx_rcd 
where usr_id=5201314520
and year(trx_time)=2024)a
inner join(select distinct mch_nm from 
 cmb_usr_trx_rcd 
 whereusr_id= 5211314521 
and year(trx_time)=2024 ) b
on a.mch_nm= b.mch_nm
2025-03-05 表连接(1)你们难道都去过?那就试试用InnerJoin 
select a.mch_nm
from 
(select distinct mch_nm
from cmb_usr_trx_rcd 
where usr_id=5201314520) a
inner join(select distinct mch_nm from 
 cmb_usr_trx_rcd 
 whereusr_id= 5211314521 )b 
on a.mch_nm= b.mch_nm
2025-03-05 子查询(1)玩的最嗨那天在做甚?要用Where子查询 
select 
	*
	from 
	cmb_usr_trx_rcd 
	where
usr_id = 5201314520
and year(trx_time) = 2024
and trx_amt =
(select max(trx_amt) 
	from 
	cmb_usr_trx_rcd 
	where
usr_id = 5201314520
and year(trx_time) = 2024 )
2025-03-05 子查询(1)玩的最嗨那天在做甚?要用Where子查询 
select 
	*
	from 
	cmb_usr_trx_rcd 
	where
usr_id = 5201314520
and trx_amt =
(select max(trx_amt) 
	from 
	cmb_usr_trx_rcd 
	where
usr_id = 5201314520)
2025-03-04 子查询(1)玩的最嗨那天在做甚?要用Where子查询 
select
	*
from 
	cmb_usr_trx_rcd
where 
	usr_id = "5201314520"
and year(trx_time)=2024
order by trx_amt desc
limit 1
2025-03-04 子查询(1)玩的最嗨那天在做甚?要用Where子查询 
select
	*
from 
	cmb_usr_trx_rcd
where 
	usr_id = "5201314520"
and year(trx_time)=2024
order by trx_amt
limit 1
2025-03-04 子查询(1)玩的最嗨那天在做甚?要用Where子查询 
select
	*
from 
	cmb_usr_trx_rcd
where 
	usr_id = "5201314520"
and year(trx_time)=2024
2025-03-04 小结(2)越花越多是死罪,按月统计Substr 
select
	substr(trx_time,1,7) trx_mon,
count(1) trx_cnt,
sum(trx_amt) trx_amt
from 
	cmb_usr_trx_rcd
where 
	usr_id = "5201314520"
and (
	((truncate(trx_amt,0) like "%88" or truncate(trx_amt,0) like "%98" )
and
	trx_amt>=200
and 
	hour(trx_time) in (23,0,1,2) )
or 
	(mch_nm rlike "足疗|保健|按摩|养生|SPA"))
and
	date(trx_time) between "2022-11-01" and "2024-12-31"
group by trx_mon
order by trx_mon
2025-03-04 小结(2)越花越多是死罪,按月统计Substr 
select
	substr(trx_time,1,7) trx_mon,
count(1) trx_cnt,
sum(trx_amt) trx_amt
from 
	cmb_usr_trx_rcd
where 
	usr_id = "5201314520"
and (
	((truncate(trx_amt,0) like "%88$" or truncate(trx_amt,0) like "%98$" )
and
	trx_amt>=200
and 
	hour(trx_time) in (23,0,1,2) )
or 
	(mch_nm rlike "足疗|保健|按摩|养生|SPA"))
and
	date(trx_time) between "2022-11-01" and "2024-12-31"
group by trx_mon
order by trx_mon
2025-03-04 小结(2)越花越多是死罪,按月统计Substr 
select
	substr(trx_time,1,7) trx_mon,
count(1) trx_cnt,
sum(trx_amt) trx_amt
from 
	cmb_usr_trx_rcd
where 
	usr_id = "5201314520"
and (
	((truncate(trx_amt,0) like "88" or truncate(trx_amt,0) like "98" )
and
	trx_amt>=200
and 
	hour(trx_time) in (23,0,1,2) )
or 
	(mch_nm rlike "足疗|保健|按摩|养生|SPA"))
and
	date(trx_time) between "2022-11-01" and "2024-12-31"
group by trx_mon
order by trx_mon
2025-03-04 小结(2)越花越多是死罪,按月统计Substr 
select
	substr(trx_time,1,7) trx_mon,
count(1) trx_cnt,
sum(trx_amt) trx_amt
from 
	cmb_usr_trx_rcd
where 
	usr_id = "5201314520"
and (
	((truncate(trx_amt,0) like "88$" or truncate(trx_amt,0) like "98$" )
and
	trx_amt>=200
and 
	hour(trx_time) in (23,0,1,2) )
or 
	(mch_nm rlike "足疗|保健|按摩|养生|SPA"))
and
	date(trx_time) between "2022-11-01" and "2024-12-31"
group by trx_mon
order by trx_mon
2025-03-04 小结(2)越花越多是死罪,按月统计Substr 
select
	substr(trx_time,1,7) trx_mon,
count(1) trx_cnt,
sum(trx_amt) trx_amt
from 
	cmb_usr_trx_rcd
where 
	usr_id = "5201314520"
and (
	((truncate(trx_amt,0) rlike "88$" or truncate(trx_amt,0) like "98$" )
and
	trx_amt>=200
and 
	hour(trx_time) in (23,0,1,2) )
or 
	(mch_nm rlike "足疗|保健|按摩|养生|SPA"))
and
	date(trx_time) between "2022-11-01" and "2024-12-31"
group by trx_mon
order by trx_mon
2025-03-04 小结(2)越花越多是死罪,按月统计Substr 
select
	substr(trx_time,1,7) trx_mon,
count(1) trx_cnt,
sum(trx_amt) trx_amt
from 
	cmb_usr_trx_rcd
where 
	usr_id = "5201314520"
and (
	((truncate(trx_amt,0) like "%88" or truncate(trx_amt,0) like "%98" )
and
	trx_amt>=200
and 
	hour(trx_time) in (23,0,1,2,3) )
or 
	(mch_nm rlike "足疗|保健|按摩|养生|SPA"))
and
	date(trx_time) between "2022-11-01" and "2024-12-31"
group by 
	trx_mon
order by 
	trx_mon
2025-03-04 计算车方和司机被禁止的比率 
select 
	role,
count(1) total_count,
count( if (banned = 1 ,1,null) ) banned_count,
concat(round(count( if (banned = 1 ,1,null) )/count(1),2)*100,"%") banned_rate
from 
	hll_t2
group by 
	role
order by 
	role
2025-03-04 计算车方和司机被禁止的比率 
select 
	role,
count(1) total_count,
count( if (banned = 1 ,1,null) ) banned_count,
concat(round(count( if (banned = 1 ,1,null) )/count(1)*100,2),"%") banned_rate
from 
	hll_t2
group by 
	role
order by 
	role
2025-03-04 计算车方和司机被禁止的比率 
select 
	role,
count(1) total_count,
count( if (banned = 1 ,1,null) ) banned_count,
concat(round(count( if (banned = 1 ,1,null) ),2)/count(1)*100,"%") banned_rate
from 
	hll_t2
group by 
	role
order by 
	role