select usr_id,mch_nm,sum(trx_amt) trx_amt,count(1) trx_cnt,min(trx_time) first_time
from cmb_usr_trx_rcd
where usr_id='5201314520' and trx_amt>=288
group by usr_id,mch_nm
order by trx_amt desc
大佬你看看这个呢
select usr_id,mch_nm,sum(trx_amt) trx_amt,count(1) trx_cnt,min(trx_time) first_time
from cmb_usr_trx_rcd
where usr_id='5201314520' and trx_amt>=288
group by usr_id,mch_nm
order by trx_amt desc
大佬你看看这个呢
select usr_id,
mch_nm,
sum(trx_amt) trx_amt,
count(1) trx_cnt,
min(trx_time) frist_time
from cmb_usr_trx_rcd
where trx_amt>=288 and usr_id='5201314520'
group by usr_id,mch_nm
order by trx_cnt desc
各位这个哪里错了提交答案就是告诉我错误的,运行倒是没有错误
select * from cmb_usr_trx_rcd where trx_amt=(
select max(trx_amt) from cmb_usr_trx_rcd where
usr_id='5201314520' and year(trx_time)='2024' ) and usr_id='5201314520' and year(trx_time)='2024'
select usr_id,mch_nm,sum(trx_amt) trx_amt,count(1) trx_cnt,min(trx_time) first_time
from cmb_usr_trx_rcd
where usr_id='5201314520' and trx_amt>=288
group by usr_id,mch_nm
order by trx_amt desc
select
usr_id
,mch_nm
,sum(trx_amt) as trx_amt
,count(1) as trx_cnt
,min(trx_time) as first_time
from
cmb_usr_trx_rcd
where
usr_id='5201314520'
and trx_amt>=288
group by usr_id, mch_nm
order by 4 desc
select usr_id,mch_nm,sum(trx_amt) trx_amt,count(1) trx_cnt,min(trx_time) first_time
from cmb_usr_trx_rcd
where usr_id=5201314520 and mch_nm>=288
group by usr_id,mch_nm
order by trx_amt
select usr_id,mch_nm,sum(trx_amt) trx_amt,count(*),min(trx_time) from cmb_usr_trx_rcd
where usr_id=5201314520 and mch_nm>=288
group by usr_id,mch_nm
order by trx_amt
limit 5
select usr_id,
mch_nm,
sum(trx_amt) trx_amt,
count(1) trx_cnt,
min(trx_time) frist_time
from cmb_usr_trx_rcd
where trx_amt>=288 and usr_id='5201314520'
group by usr_id,mch_nm
order by trx_cnt desc
select usr_id,
mch_nm,
sum(trx_amt) trx_amt,
count(1) trx_cnt,
min(trx_time) frist_time
from cmb_usr_trx_rcd
where trx_amt>=288 and usr_id='5201314520'
group by usr_id,mch_nm
order by trx_cnt desc
limit 5
select
trx_amt,
count(1) as total_trx_cnt,
count(distinct usr_id) as unique_usr_cnt,
count(1) / count(distinct usr_id) as avg_trx_per_user
from
cmb_usr_trx_rcd
where
mch_nm = '红玫瑰按摩保健休闲'
and ((year(trx_time) = 2023 and month(trx_time) between 1 and 12)
or (year(trx_time) = 2024 and month(trx_time) between 1 and 6) )
group by
trx_amt
order by
avg_trx_per_user desc
limit 5;
select
trx_amt,
count(1) as total_trx_cnt,
count(distinct usr_id) as unique_usr_cnt,
count(1) / count(distinct usr_id) as avg_trx_per_user
from
cmb_usr_trx_rcd
where
mch_nm = '红玫瑰按摩保健休闲'
and ((year(trx_time) = 2023 and month(trx_time) between 1 and 12)
or (year(trx_time) = 2024 and month(trx_time) between 1 and 6) )
group by
trx_amt
order by
avg_trx_per_user desc
limit 5;
select
trx_amt,
count(1) as total_trx_cnt,
count(distinct usr_id) as unique_usr_cnt,
count(1) / count(distinct usr_id) as avg_trx_per_user
from
cmb_usr_trx_rcd
where
mch_nm = '红玫瑰按摩保健休闲'
and (year(trx_time) = 2023 and month(trx_time) between 1 and 12)
and (year(trx_time) = 2024 and month(trx_time) between 1 and 6)
group by
trx_amt
order by
avg_trx_per_user desc
limit 5;
select
trx_amt,
count(1) as total_trx_cnt,
count(distinct usr_id) as unique_usr_cnt,
count(1) / count(distinct usr_id) as avg_trx_per_user
from
cmb_usr_trx_rcd
where
mch_nm = '红玫瑰按摩保健休闲'
and (year(trx_time) = 2023 and month(trx_time) between 1 and 12)
or (year(trx_time) = 2024 and month(trx_time) between 1 and 6)
group by
trx_amt
order by
avg_trx_per_user desc
limit 5;
select trx_amt,count(trx_amt) trx_cnt from cmb_usr_trx_rcd
where mch_nm='红玫瑰按摩保健休闲' and
date(trx_time) between '2024-01-01' and '2024-07-31'
group by trx_amt
order by trx_cnt desc
limit 5