Hi,
how to select the duplicate records(entire row is not duplicate, only couple of columns only duplicated) from a table.
for ex: emp
--------
empno ename hiredate(varchar2) sal
1 first 01-01-1980 5000
2 first 01-01-1980 4000
3 first 01-01-1980 3000
4 second 01-01-1960 6000
5 third 01-01-1970 7000
How to find out the records where ename should match with hiredate more than one record.
The query should result:
empno ename hiredate(varchar2) sal
1 first 01-01-1980 5000
2 first 01-01-1980 4000
3 first 01-01-1980 3000
How to write the query for the above result.
(I know the query if the entire row is duplicate.
select * from emp
group by empno,ename,hiredate,sal
having count(ename || hiredate) > 1;
).
I tried with maxrowid also. but could not solve.
help please.
Thanks very much.
how to select the duplicate records(entire row is not duplicate, only couple of columns only duplicated) from a table.
for ex: emp
--------
empno ename hiredate(varchar2) sal
1 first 01-01-1980 5000
2 first 01-01-1980 4000
3 first 01-01-1980 3000
4 second 01-01-1960 6000
5 third 01-01-1970 7000
How to find out the records where ename should match with hiredate more than one record.
The query should result:
empno ename hiredate(varchar2) sal
1 first 01-01-1980 5000
2 first 01-01-1980 4000
3 first 01-01-1980 3000
How to write the query for the above result.
(I know the query if the entire row is duplicate.
select * from emp
group by empno,ename,hiredate,sal
having count(ename || hiredate) > 1;
).
I tried with maxrowid also. but could not solve.
help please.
Thanks very much.