|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
how to select duplicate record from a table?
how to select only dupliate record from a table??
for eg. i want to select records that have same duplicate id in table A. how can i do tat? |
|
#2
|
|||
|
|||
|
Code:
select id from A group by id having count(*) > 1 |
|
#3
|
|||
|
|||
|
Here is an example on the world most popular table EMP. Try it.
SELECT * FROM emp a WHERE rowid = (SELECT max(rowid) FROM emp WHERE empno = a.empno GROUP BY empno HAVING count(*) >1) |
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > how to select duplicate record from a table? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|