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



I have table-A(1,2,3,4,4,5,6,6,6,7). how to get all duplicate values?what is sql query?..

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

I have table-A(1,2,3,4,4,5,6,6,6,7). how to get all duplicate values?what is sql query?..

Answer / sudipta santra

select * from A group by no having count(*)>1 ;

Is This Answer Correct ?    7 Yes 3 No

I have table-A(1,2,3,4,4,5,6,6,6,7). how to get all duplicate values?what is sql query?..

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

I have table-A(1,2,3,4,4,5,6,6,6,7). how to get all duplicate values?what is sql query?..

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

I have table-A(1,2,3,4,4,5,6,6,6,7). how to get all duplicate values?what is sql query?..

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

Post New Answer

More Oracle General Interview Questions

When a form is invoked with call_form, Does oracle forms issues a save point ?

1 Answers   Oracle,


What do database buffers contain?

0 Answers  


What is dual table oracle?

0 Answers  


16. Display the order number, order line number and the shipping date. If the shipping date is null, display the string <not shipped yet>.

1 Answers   Wipro,


What is a sub query? What are its various types?

0 Answers  






Can we create trigger on materialized view in oracle?

0 Answers  


cursor attributes are %isopen ,%notfound,%found,%rowcount but is any attributes there other than these? please tell me asap ..

2 Answers  


What is the difference between implicit index and explicit index?

2 Answers   TCS,


How do I connect to oracle?

0 Answers  


Is oracle a programming language?

0 Answers  


Use of an integrity constraint is better to validate data. Explain

0 Answers  


ex. one table is having 1 column with 10 records , then how to display all the values in row wise ?

4 Answers  


Categories
  • Oracle General Interview Questions Oracle General (1789)
  • Oracle DBA (Database Administration) Interview Questions Oracle DBA (Database Administration) (261)
  • Oracle Call Interface (OCI) Interview Questions Oracle Call Interface (OCI) (10)
  • Oracle Architecture Interview Questions Oracle Architecture (90)
  • Oracle Security Interview Questions Oracle Security (38)
  • Oracle Forms Reports Interview Questions Oracle Forms Reports (510)
  • Oracle Data Integrator (ODI) Interview Questions Oracle Data Integrator (ODI) (120)
  • Oracle ETL Interview Questions Oracle ETL (15)
  • Oracle RAC Interview Questions Oracle RAC (93)
  • Oracle D2K Interview Questions Oracle D2K (72)
  • Oracle AllOther Interview Questions Oracle AllOther (241)