sql修改~
select collacct.custid,
collacct.account,
collacct.cmbcflag,
collacct.accttype,
collacct.acctentpertype,
collacct.acctname,
collacct.currcode,
collacct.openbranchname,
collacct.openbranchaddr,
collacct.openbranchcode,
collacct.movtelno,
collacct.emailaddr,
collacct.pathcode,
collacct.bnkcode,
collacct.alisa,
collacct.remark,
collacct.recvcount,
collacct.wyhlbranchcode,
collacct.wyhlbranchname,
(select p.trancode
from note_pay p
where p.custid = collacct.custid
and p.payeracc = '4155990100000535'
and p.payeeacc = collacct.account) as trancode
from collacct collacct
WHERE collacct.custid = '1013989930'
and collacct.cmbcflag in ('1', '0')
and (collacct.account not in
(select payeeacc from note_pay where payeracc = '4155990100000535') or
account in (select payeeacc
from note_pay
where payeracc = '4155990100000535'
and flag = '1'))
order by collacct.recvcount desc
当collacct.cmbcflag 等于1的时候
要增加
((collacct.openbranchcode <> '' and
collacct.openbranchcode is not null) or collacct.cmbcflag='1')
or ((collacct.wyhlbranchcode <> '' and
collacct.wyhlbranchcode is not null) or collacct.cmbcflag='1')
过滤条件