我尝试了此查询
[^%&\\\'+"]
结果为select count(id) as id_name, category as media
from tb_gadar
where d BETWEEN '2018-04-01' and '2019-12-31'
and category in ('Laki-laki','Perempuan')`
如何将144, Laki-laki
更改为Laki-laki
?
答案 0 :(得分:2)
您可以使用CASE
语句来完成
select count(id) as id_name,
case when category = 'Laki-laki' then 'Umum' else category end as media
from tb_gadar
where d BETWEEN '2018-04-01' and '2019-12-31'
and category in ('Laki-laki','Perempuan')
group by category