SQL 中 where 条件中 in 后面 加 CASE WHEN 语句 报错
select new_projectsize, count(cifno)
from (select distinct (a.cifno) as cifno,
b.new_projectsize as new_projectsize
from cr_xdall a, cr_corp_inf b
where substr(a.mon_date, 1, 6) = '201212'
and xdflag = '1'
and opn_br_no in
(case when '1' = '1' then
(select brno from poozfmessagebrno where upbrno = '56601') else
'50000' end)
and a.cifno = b.cifno
and bal != '0'
group by b.new_projectsize, a.cifno)
group by new_projectsize;
sql
------解决方案--------------------表结构呢
是可以用,
建议你用排除法,
------解决方案--------------------楼主SQL有待提高,表结构贴出来才能给你看看
------解决方案--------------------select brno from poozfmessagebrno where upbrno = '56601'
这句查查出来的是否能有唯一的一条值。。。
另,报的什么错。。。错误代码多少??