| 订阅 | 在线投稿
分享
 
 
 

oracle中用not in性能不好,但我不知下面的语句该如何优化,还望高手指点

来源:互联网  宽屏版  评论
2004-12-01 13:50:56

本文为【oracle中用not in性能不好,但我不知下面的语句该如何优化,还望高手指点】的汉字拼音对照版显示拼音

select a.id as id,b.username as username,c.username as payto,a.amount as amount,a.trade_time as trade_time,d.explanation as explanation from trade_line a,user_info b,user_info c,trade_type d where a.id not in (select id from trade_line where rownum<={(curpage-1)*pagesize)} and trade_type like {tradetype} and (user_id='{loginBean.getUserId()}' or payto_id='{loginBean.getUserId()}') and to_char(trade_time,'YYYYMMDD') between '{begindate}' and '{enddate}') and rownum<={pagesize} and a.trade_type like '{tradetype}' and (a.user_id='{loginBean.getUserId()}' or a.payto_id='{loginBean.getUserId()}') and to_char(a.trade_time,'YYYYMMDD') between '{begindate}' and '{enddate}' and a.user_id=b.user_id and a.payto_id=c.user_id and a.trade_type=d.trade_type order by a.id;

qizhongdakuohaoneideshibianliang

原文
select a.id as id,b.username as username,c.username as payto,a.amount as amount,a.trade_time as trade_time,d.explanation as explanation from trade_line a,user_info b,user_info c,trade_type d where a.id not in (select id from trade_line where rownum<={(curpage-1)*pagesize)} and trade_type like ‘{tradetype}’ and (user_id='{loginBean.getUserId()}' or payto_id='{loginBean.getUserId()}') and to_char(trade_time,'YYYYMMDD') between '{begindate}' and '{enddate}') and rownum<={pagesize} and a.trade_type like '{tradetype}' and (a.user_id='{loginBean.getUserId()}' or a.payto_id='{loginBean.getUserId()}') and to_char(a.trade_time,'YYYYMMDD') between '{begindate}' and '{enddate}' and a.user_id=b.user_id and a.payto_id=c.user_id and a.trade_type=d.trade_type order by a.id; 其中大括号内的是变量
󰈣󰈤
 
 
 
>>返回首页<<
 
 热帖排行
 
 
王朝网络微信公众号
微信扫码关注本站公众号wangchaonetcn
 
 
静静地坐在废墟上,四周的荒凉一望无际,忽然觉得,凄凉也很美
©2005- 王朝网络 版权所有