I have table-A(1,2,3,4,4,5,6,6,6,7).
how to get all duplicate values?what is sql query?
Answers were Sorted based on User's Feedback
Answer / vikas
select *
from a
where rowid not in (select min(rowid) from a group by no)
no is column in table a;
| Is This Answer Correct ? | 10 Yes | 2 No |
Answer / sudipta santra
select * from A group by no having count(*)>1 ;
| Is This Answer Correct ? | 7 Yes | 3 No |
Answer / sam
SELECT num,
COUNT(num) AS NumOccurrences
FROM A
GROUP BY num
HAVING ( COUNT(num) > 1 )
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / nathan
SELECT sal,rn
FROM (SELECT ROW_NUMBER () OVER (PARTITION BY sal ORDER BY
empno DESC) rn,
sal
FROM emp)
WHERE rn > 1;
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / a.brahmam
delete from table name
where rowid not in(select max(rowid) from table name group by column name)
| Is This Answer Correct ? | 0 Yes | 0 No |
How to create a new table by selecting rows from another table?
What privilege is needed for a user to insert rows to tables in another schema?
what are different types of deletes?
Can we write dml statement in function in oracle?
what is load balancing and what u have used to do this?(sql loader)
How to create a new table in your schema?
What is the difference difference between $ORACLE_HOME and $ORACLE_BASE.
How to define an explicit cursor in oracle?
How to export data to a csv file?
i can create a view with two columns from emp table,, later i need to add one more emp column to existing view.. what is query similarly add one more column to existing primary key constraint.. please give me the solutions
What is the difference between primary key and unique key and foreign key in oracle?
Why is oracle so popular?