22,209
社区成员
发帖
与我相关
我的任务
分享
--这个count跟lcaccount表其实没有半毛钱关系
select COUNT(appntno) from(
select b.appntno from lccont b,lcpol c where b.contno=c.contno and c.appflag='1'
union
select c.insuredno from lccont b,lcpol c where b.contno=c.contno and c.appflag='1'
) t
select count(distinct (a.customerno))
from lcaccount a
where exists(select 1 from lccont b,lcpol c where b.contno=c.contno and c.appflag='1' and a.customerno in(b.appntno,c.insuredno))