有一个表A(a,b,c,d,e)记录有:
a1,b1,c1,d1,e1
a2,b1,c1,d1,e1
a3,b1,c1,d1,e2
a4,b2,c1,d1,e3
a5,b2,c1,d1,e3
a6,b2,c1,d1,e3将b,c,d,e 相同的记录去掉。怎么样写
a1,b1,c1,d1,e1
a2,b1,c1,d1,e1
a3,b1,c1,d1,e2
a4,b2,c1,d1,e3
a5,b2,c1,d1,e3
a6,b2,c1,d1,e3将b,c,d,e 相同的记录去掉。怎么样写
解决方案 »
- oracle 中update语句中如何排序呢
- 请问大家都用什么方法备份Oracle?
- 请教一下,oracle数据库,字段date用字符串来表示日期时间:2007-10-10 10:10:10想找出date的值为当前日期,如列出date为2007-11-29号的记录的select语句怎样写
- 很好的问题
- select 'A' + a.company_id as new_id from t_pub_user a
- asp访问oracle 8.1.6 BLOB类型数据的问题
- 谁能解答这个问题?超难
- 一个简单问题,寻求帮忙
- 安装ORALCE8.17失败请各位高手帮忙~!!!!
- 【求助】11g expdp 导数
- oracle job 不失效但不运行
- oracle 管理员手册
select a,b,c,d,e from (
select a,b,c,d,e,row_number()over(partition by b,c,d,e order by a) rn
from A
)
where rn=1;
a2,b1,c1,d1,e1
比如说这里条吧,你说的去掉是把两条都去掉呢,还是去掉其中的一天啊?
from tb where rowid in(select max(rowid) from tb group by b,c,d,e)
select b,c,d,e from (
select b,c,d,e,count(a) rn
from A
group by b,c,d,e
)
where rn=1;
a b c d
1 2 2 2
2 2 2 2
3 1 1 1
3 1 1 1
2 3 3 3--结果这样
a b c d row_number()over(partition by b,c,d order by a) rn
1 2 2 2 1
2 2 2 2 2
3 1 1 1 1
5 1 1 1 2
2 3 3 3 1
from emp
把这个拿去运行下就知道了
from emp
把这个拿去运行下就知道了
( select a from(
select a,b,c,d,e,count()over(partition by b,c,d,e) tot from A) B
where B.tot>=2
)
exists(select 1 from A t2 where t1.b = t2.b and t1.c = t2.c and t1.d = t2.d
and t1.e = t2.e and t1.a <> t2.a)