Q3. How will you fetch duplicate values from a DB2 table?

Answers were Sorted based on User's Feedback



Q3. How will you fetch duplicate values from a DB2 table?..

Answer / ganesh

select column1, column 2, count('X') from Table_name
group by column1, column 2
having integer(count('X')) > 1

Is This Answer Correct ?    16 Yes 4 No

Q3. How will you fetch duplicate values from a DB2 table?..

Answer / ramana99

select City, Country, count('X') from Customers
group by City, Country
HAVING count('X') > 1
;

Is This Answer Correct ?    8 Yes 0 No

Post New Answer

More DB2 Interview Questions

can any one provide me the link for the db2 v7 & db2 v8 manual for Z/os? i need to know about the syntax of REORG in both versions & need to know the difference as well

0 Answers  


How would one remove old reorg information from the DB2 catalog?

2 Answers  


Write a query to extract first 5 characters of a name in the column Stud_Name?

1 Answers   RBS,


Could anyone clearly explain the diference between sub query and correlated sub query?

3 Answers  


What if we fail to give values in columns declared as NOT NULL ?

3 Answers   Cap Gemini,






what are extents?

5 Answers  


In my table having 100 Rec. How can I delete the 7th row?? (we don't know what is data inside the table)

9 Answers   IBM,


what is Static and dynamic linking

1 Answers   Virtusa,


What is the significance of DB2 free space and what parameters control it?

1 Answers  


how can u understand the end of the table ?

1 Answers   TCS,


what is the difference between join and union?

4 Answers   IBM,


What are the various locks available?

5 Answers   CTS,


Categories