select ... from a,(select distinct bid from b) b
where b.bid=a.bid;
where b.bid=a.bid;
解决方案 »
- 在linux下,oracle isqlplus dba登录出现TNS:could not resolve the connect identifier spec
- oracle分组查询
- 英文oracle如何支持中文?
- 简单问题,不好意思,老弟没有分数了,可怜我把
- 想不通还有这样的问题!请来看看!
- ★集寻Oracle 7.3.4 for windows2000安装程序★
- 怎么导数据啊?
- 多条记录合并成一条?
- 请问现在考8i的证还有用吗?现在不都是考9i的证了吗??
- 插入或者删除一条数据,为什么出现俩个TM锁??
- Oracle9i中如何能同时导出多个表的sql脚本,用第三方工具也成,最好oracle提供?
- SQL语言问题
如果你需要 b 中的其他字段值的话这样还不行select ... from a,b
where b.bid=a.bid and b.rowid =
(select max(rowid) from b bb where bb.bid = b.bid);
where a.id=s.id
select ... from a,(select id,a1,a2,...,an,max(bid) b_id from b group by id,a1,a2,...,an) s
where a.id=s.id
select ... from a,(select id,max(bid) b_id,max(f1),max(f2),...,max(fn) from b group by id) s
where a.id=s.id
where b.bid=a.bid;
from a,b
where a.id = b.id
and b.bid = (select min(b_se.bid) from b b_se where b_se.id = b.id)
select ... from a,b
where b.bid=a.bid and b.rowid =
(select max(rowid) from b bb where bb.bid = b.bid)
union all
select .... from a,b where a.bid = b.bid(+) and b.bid is null;
from a,
(select * from b where b.rowid in (select min(rowid) from b group by id)) b_se
where a.id = b_se.id(+)
where b.bid=(select min(bid) from b where id=b1.id)) b2
where b2.id(+)=a.id谢谢大家
应该把bid 都换成 id 吧 :)
you are right