| 发表于:2007-05-22 21:14:29 楼主 |
select iounbr from ln.tiou where lndate=20070520 and ioust = '2 ' and clttype= 'cm ' //正常 union select iounbr from ln.tiou where (select coalesce(max(transdate),0) from ln.tlnserver where iounbr=ln.tiou.iounbr)=20070520 and ioust = '4 ' and clttype= 'cm ' //结清 union select iounbr from ln.tclbook where cldate=20070520 and ioust in ( '6 ', 'a ', 'b ') and iounbr in (select iounbr from ln.tiou where clttype= 'cm ') //转逾期,呆滞,呆帐 union select iounbr from ln.texpbook where expdate=20070520 and prmark= '1 ' and iounbr in (select iounbr from ln.tiou where clttype= 'cm ') //转展期 union select iounbr from ln.treplnbk where transdate=20070520 and capinflg= 'a ' and trstype <> '1 ' and iounbr in (select iounbr from ln.tiou where clttype= 'cm ')//还款 上面这个sql数据库执行要35秒,超时,有没有办法换一种写法,高效率的实现我上面的想法 |
|
|
|
|