select CASE
WHEN 类别 IN ( 'aa', 'bb' ) then 'ab'
WHEN 类别 IN ( 'AA', 'BB' ) then 'AB'
END AS 列 ,
a.列1 ,
count(*)
from a, b
where a.姓名=b.姓名
${if(len(控件)=0,""," and 列 = '"+控件+"'")}
group by 列,列1
如果不选就会显示表内容,但是如果控件选择列里面的ab或AB就报错,那里有错了呢
select * from (
) a
WHEN 类别 IN ('aa', 'bb') then
'ab'
WHEN 类别 IN ('AA', 'BB') then
'AB'
END AS 列,
a.列1,
where a.姓名 = b.姓名
${if(len(控件) = 0, "", " and 列 = '" + 控件 + "'") }
group by CASE
END,
列1