select * from tbname
where rowid in(
select min(rowid) from tbname group by c1,c2,c3);
where rowid in(
select min(rowid) from tbname group by c1,c2,c3);
解决方案 »
- Oracle Database Upgrade for solaris 的可行性
- 用触发器刷新物化视图
- 请大家帮忙翻译一条sql server的语句
- 共享内存应该大于512M*进程数, 600M 共享内存只能 有一个oracle进程?
- TNS:no listener 如何解决
- ORA-01033: ORACLE initialization or shutdown in progress,shutdown abort>startup试过也不行。。。
- PLSQL如何获取更新件数
- sql/plus的问题,请大家帮帮忙!参与者有分。
- 关于oracle中用户密码的问题
- oci问题
- 触发器为什么会失效?怎样自动编译失败的触发器?
- oracle的时间修改问题
select tbname.* from
(select min(rowid) rid from tbname group by c1,c2,c3) t,
tbname
where t.rid=tbname.rowid(+);
where rowid in(
select min(rowid) from tbname group by c1);
或者:
select tbname.* from
(select min(rowid) rid from tbname group by c1) t,
tbname
where t.rid=tbname.rowid(+);
(select min(id) id from tbname group by c1) t,
tbname
where t.id=tbname.id(+);
select * from tbname
where rowid in(
select min(rowid) from tbname group by c1);
我只要C1列不同的首条记录
where rowid in(
select min(rowid) from tbname group by c1,c2,c3);这个in可以直接用“=”吧,还有楼主说的是第一条c1列不同,那时不是group by的时候只需要c1就够了那?第二种写法是什么意思哪????应该是为什么还要(+)
---------- ---------- ---------- ----------
1 a aa aaa
3 b bb aaa
4 c aa ccc
(select min(id) id from tbname group by c1) t,
tbname
where t.id=tbname.id(+);
----- ---------- ---------- ----------
1 a aa aaa
3 b bb aaa
4 c aa ccc