select
a.*
from
表 a
where
(a.Field1,a.Field2)=(select (Field1,Field2)
from 表
where ID1=a.ID1 and ID2=a.ID2 and ID3=a.ID3 and rownum=1)
a.*
from
表 a
where
(a.Field1,a.Field2)=(select (Field1,Field2)
from 表
where ID1=a.ID1 and ID2=a.ID2 and ID3=a.ID3 and rownum=1)
解决方案 »
- 求解决一个本人没有涉及过的SQL问题,欢迎抢答!!!
- oracle国家字符集有什么用?
- 开发区,贴 了一天了,一个回复的都没有:c# 调用过程,报 {"ORA-01036: 非法的变量名/编号\n"}
- v_$session问题
- oracle支持varray和nested table 数据库类型的最早版本是多少
- 事务中怎么不能使用ALTER TABLE语句呀?
- 关于几个表关联优化的问题?
- 还有人吗?急死了。很简单的问题。
- oracle 可否用unicode方式存字符
- 创建临时表空间时出错了
- select ltrim('abc_abc','_') from dual;
- 谁能帮帮我!SQL查询问题!
(select 1 from tb where ID1='01' and id3=a.id3 and id2<a.id2 );
(
select ID1, ID2 , ID3 , Field1 , Field2,row_number()over(partition by id3 order by id2) as rn
from a)
where rn=1
(
select ID1, ID2 , ID3 , Field1 , Field2,row_number()over(partition by id3 order by id2) as rn
from a where ID1 ='01')
where rn=1