select trx_amt,count(*) as trx_cnt from cmb_usr_trx_rcd where mch_nm='红玫瑰按摩保健休闲' and trx_time >= '2024-1-1' and trx_time <= '2024-7-31' group by trx_amt order by trx_cntdesclimit 5;
select trx_amt,count(*) as trx_cnt from cmb_usr_trx_rcd where mch_nm='红玫瑰按摩保健休闲' and trx_time >= '2024-1-1' and trx_time <= '2024-7-31' group by trx_amtlimit 5;
select date(trx_time) as trx_date,max(trx_amt),min(trx_amt), avg(trx_amt), sum(trx_amt) from cmb_usr_trx_rcd where mch_nm ='红玫瑰按摩保健休闲' and trx_time >='2024-9-1' and trx_time <'2024-10-1' group by date(trx_time) order by trx_date
selectmax(trx_amt),min(trx_amt), avg(trx_amt), sum(trx_amt) from cmb_usr_trx_rcd where mch_nm ='红玫瑰按摩保健休闲' and trx_time >='2024-9-1' and trx_time <'2024-10-1' group by date(trx_time)
selectmch_nm , count(trx_amt) as sum_trx_amt from cmb_usr_trx_rcdwhere usr_id ='5201314520' and trx_time >= '2024-1-1' and trx_time < '2025-1-1'group by mch_nm
select * from cmb_usr_trx_rcd where usr_id ='5201314520' and trx_time >= '2024-9-1' and trx_time < '2024-10-1' and (hour(trx_time) >= 22 or hour(trx_time) <= 5)
select * from cmb_usr_trx_rcd where usr_id ='5201314520' and trx_time >= '2024-9-1' and trx_time < '2024-10-1' and hour(trx_time) >= 22 or hour(trx_time) <= 5
select * from cmb_usr_trx_rcd where usr_id ='5201314520' and trx_time >= '2024-9-1' and trx_time < '2024-10-1' and hour(trx_time) >= 22 and hour(trx_time) <= 5