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 define a sub function?
How can we create the complete backup of data in the oracle.
0 Answers IPEC, Satyam, SunTec,
Does facebook use oracle?
Explain the relationship among Database, Tablespace and Data file?
Explain about functional dependency and its relation with table design?
How to save query output to a local file?
Can we create trigger on materialized view in oracle?
What is the Extension of Oracle Database? As extension of Access Database is .mdb
What are the components of Physical database structure of Oracle Database?
Provide an example of a shell script which logs into SQLPLUS as SYS, determines the current date, changes the date format to include minutes & seconds, issues a drop table command, displays the date again, and finally exits.
How to connect to the server with user account: sys?
How to call a stored function in oracle?