select count(*) from (select distinct cifno from cr_xdls where mon_date='20130350' and brno like '10%' and projectsize in('01') and bal > 0 and outflag in('1','2'))
请各位大虾,将上面的语句 帮我改成,以 projectsize 字段分组格式!急!!!灰尘感谢!Oracle
请各位大虾,将上面的语句 帮我改成,以 projectsize 字段分组格式!急!!!灰尘感谢!Oracle
from (select distinct cifno from cr_xdls where mon_date='20130350' and brno like '10%' and projectsize in('01') and bal > 0 and outflag in('1','2')) tt
group by tt.projectsize
group by projectsize 楼上这位改写的有点吓人啊,我是手机弄的,不知道ok不
select projectsize,count(distinct cifno) from cr_xdls where mon_date='20130350' and brno like '10%' and projectsize in('01') and bal > 0 and outflag in('1','2'))
;
按照楼主语句的理解,楼上在统计时,应该少了去除重复的操作 count(distinct cifno)