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;
红色字体位置,还能用什么关键字代替啊求解啊
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;
红色字体位置,还能用什么关键字代替啊求解啊
如果昰只想在SQL中实现的话,可以写个存储过程啊,一个sql语句不是太理想啊。
where a1.host_acc='10000000001902'
union all
select a1.host_acc,a1.BALANCE from ACCTXN_HIS_DETAIL a1
where a1.host_acc='10000000031803'
...
这样