oracle中in关键字除了使用exists代替外还有其他什么没有啊???代码:
select a1.host_acc,a1.BALANCE from ACCTXN_HIS_DETAIL a1 
where a1.host_acc in ('10000000001902','10000000031803','10000000068005','10000000119103',','10000000075601'10000000137901') and a1.tran_time = (select max(a2.tran_time) from 
ACCTXN_HIS_DETAIL a2 where a2.host_acc = a1.host_acc and a2.tran_date = a1.tran_date
group by a1.host_acc) and a1.tran_date = (select max(a3.tran_date) from ACCTXN_HIS_DETAIL a3 
where a3.host_acc = a1.host_acc and a3.tran_date < to_date('2012-06-26','yyyy-MM-dd')
group by a1.host_acc) group by a1.host_acc,a1.BALANCE;
红色字体位置,还能用什么关键字代替啊求解啊

解决方案 »

  1.   

    (a1.host_acc='10000000001902' or a1.host_acc='10000000031803' or......)
      

  2.   

    没有,因为数据量超过了百万条,太大了,但是又无法使用exists,因为是查询两个数据库的,所以('10000000001902','10000000031803','10000000068005','10000000119103',','10000000075601'10000000137901') 这里面的值只能用拼接的,而exists不支持拼接,所以要替换啊
      

  3.   

    这个也是不行啊,在我查询这个【ACCTXN_HIS_DETAIL】表的话是存在另外一个数据库中的,我只有查询权限,没有其他的任何权限
      

  4.   

    不知道你什么目的啊,要是java中,或者C#中的话,你可以两个数据库,分别取出啊。
    如果昰只想在SQL中实现的话,可以写个存储过程啊,一个sql语句不是太理想啊。
      

  5.   

    我是在java中使用JDBC调用执行这个语句的,我说了啊
      

  6.   

    select a1.host_acc,a1.BALANCE from ACCTXN_HIS_DETAIL a1  
    where a1.host_acc='10000000001902'
    union all
    select a1.host_acc,a1.BALANCE from ACCTXN_HIS_DETAIL a1  
    where a1.host_acc='10000000031803'
    ...
    这样