how to get duplicate records from tables?write qurey for this?

Answers were Sorted based on User's Feedback



how to get duplicate records from tables?write qurey for this?..

Answer / anshuman

Select column_name1,column_name2
from table_T
group by column_name1 having count(*)>1

it will give all the duplicates value of column_name1

Is This Answer Correct ?    28 Yes 7 No

how to get duplicate records from tables?write qurey for this?..

Answer / mahesh babu

select column_name,count(*) from table_name group by
column_name having count>1.

Is This Answer Correct ?    6 Yes 2 No

how to get duplicate records from tables?write qurey for this?..

Answer / naresh k

select * from table_name;
The above qurey get duplicate record also because the
database store records like multi-set..
if we want get distinct records then use following query.
select distinct(attribute_name) from table name

Is This Answer Correct ?    0 Yes 15 No

how to get duplicate records from tables?write qurey for this?..

Answer / pandu

To get the duplicate records in a table use the query
Select distinct(deptno) from emp;
reply any one to me am i correct.

Is This Answer Correct ?    2 Yes 26 No

Post New Answer

More DB2 Interview Questions

Which command is used to remove all rows from a table?

0 Answers  


What information is held in SYSIBM.SYSCOPY?

1 Answers  


What is netezza database?

0 Answers  


Can any one tell me about Restart logic in DB2.

2 Answers  


How does cobol compile db2 program?

0 Answers  






What is a dbrm in db2?

0 Answers  


How to find the number of rows in a db2 table?

0 Answers  


What is referential integrity?

5 Answers  


what's the best lock size that you could use when you create a tablespace?

2 Answers   IBM,


What are the 2 sqlcodes that are returned?

0 Answers  


How do I import a csv file into db2?

0 Answers  


How would you move a tablespace (using STOGROUP) to a different DASD volume allocated to that tablespace?

1 Answers  


Categories