select
city,
count(case when con like '%多云%' then 1 end) as cloudy_days,
concat(round(
count(case when con like '%多云%' then 1 end) / count(con),
2)*100.0,'%'
) as p
from
weather_rcd_china
where
year(dt) = 2021
group by
city
order by
cloudy_days desc
select
city,
count(case when con like '%多云%' then 1 end) as cloudy_days,
concat(round(
count(case when con like '%多云%' then 1 end) / count(con),
2),'%'
)*100.0 as p
from
weather_rcd_china
where
year(dt) = 2021
group by
city
order by
cloudy_days desc
select
city,
count(case when con like '%多云%' then 1 end) as cloudy_days,
concat(round(
count(case when con like '%多云%' then 1 end) * 100.0 / count(con),
2),'%'
) as p
from
weather_rcd_china
where
year(dt) = 2021
group by
city
order by
cloudy_days desc
select
city,
count(case when con like '%多云%' then 1 end) as cloudy_days,
round(
count(case when con like '%多云%' then 1 end) * 1.0 / count(con),
2
) as p
from
weather_rcd_china
where
year(dt) = 2021
group by
city
order by
cloudy_days desc
select
city,
count(case when con like '%多云%' then 1 end) as cloudy_days,
round(
count(case when con like '%多云%' then 1 end) * 1.0 / count(con),
2
) as p
from
weather_rcd_china
where
year(dt) = 2021
group by
city;
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
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
order by ser_typ
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(trx_time) as first_date
from
cmb_usr_trx_rcd
where
usr_id = '5201314520'
and mch_nm = '红玫瑰按摩保健休闲'
group by
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
order by ser_typ
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 '不知名项目'
end as ser_typ,
count(trx_amt) as trx_cnt,
min(trx_time) as first_date
from
cmb_usr_trx_rcd
where
usr_id = '5201314520'
and mch_nm = '红玫瑰按摩保健休闲'
group by
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 '不知名项目'
end
order by ser_typ
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 '不知名项目'
end as ser_typ,
count(trx_amt) as trx_cnt,
min(trx_time) as first_date
from
cmb_usr_trx_rcd
where
usr_id = '5201314520'
and mch_nm = '红玫瑰按摩保健休闲'
group by
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 '不知名项目'
end
select
case
when trx_amt = 288 then 'WithHand'
when trx_amt = 388 then 'WithMimi'
when trx_amt = 588 then 'BlowJobbie'
when trx_amt = 888 then 'Doi'
when trx_amt = 1288 then 'DoubleFly'
else '不知名项目'
end as ser_typ,
count(trx_amt) as trx_cnt,
min(trx_time) as first_date
from
cmb_usr_trx_rcd
where
usr_id = '5201314520'
and mch_nm = '红玫瑰按摩保健休闲'
group by
case
when trx_amt = 288 then 'WithHand'
when trx_amt = 388 then 'WithMimi'
when trx_amt = 588 then 'BlowJobbie'
when trx_amt = 888 then 'Doi'
when trx_amt = 1288 then 'DoubleFly'
else '不知名项目'
end
select usr_id,mch_nm,sum(trx_amt),count(mch_nm) as trx_cnt,min(trx_time) as first_time from cmb_usr_trx_rcd where trx_amt >= 288 and usr_id = '5201314520'group by mch_nm order by trx_cnt desc