请问,如何将WHERE中的限制项以字符串赋给 estr
select 'aa' sga,case
when count(*)=0 then
'不存在' ||to_char(b) --执行报错。
when count(*)>1 then
'bb'||count(*)||'条记录,大于1' || to_char(b) --执行报错。
end estr
from tablea
where a = '1'
and b = '2'
------解决思路----------------------
只看SQL语法的话,缺少group by b,具体业务还要楼主自己看一下