Suppose there are many duplicate records in a Db2 table.
What is the query to retrive only duplicate records?
Answers were Sorted based on User's Feedback
Answer / gouri
select column_1 from tablename groupby column1 having coun(*)>1
Is This Answer Correct ? | 11 Yes | 4 No |
Answer / chidambara subbu
SELECT City FROM Customers
Group by City
HAVING COUNT(City) > 1
Is This Answer Correct ? | 3 Yes | 0 No |
Answer / sanj
say col1 is having duplicates in table tabA.Then,
select col1 from tabA
group by col1 having (count(col1) > 1)
Is This Answer Correct ? | 4 Yes | 4 No |
SELECT <COLUMN_1> FROM TABLENAME
GROUP BY COLUMN_1
HAVING COUNT(COLUMN_1) > 1
OR
SELECT <COLUMN_1> FROM TABLENAME
GROUP BY COLUMN_1
HAVING COUNT(*) > 1
Is This Answer Correct ? | 0 Yes | 0 No |
I understand Join always perform better than subqueries. Then what is the advantage/use of Subqueries/correlated subqueries etc.,in DB2 programming.Please explain.
In db2, how do you insert multiple rows in 1 query using a.) Cursors, b.) Normal query?? Give syntax for both.
What is the use of COMMAREA ?Minimum how much data we can pass from it?
For a db2 column that is being defined as decimal (11, 2), discuss the cobol picture clause.
What is check constraint in db2?
Why might full image copies be faster to implement than an incremental image copy?
Why do chiropractors use drop table?
4. A DB2 application is bound with uncommitted Read isolation level.It issues a request that retrieves 20 rows out of 200000 in the table. Which of the following descrbes the rows that are locked as a result of this request? a. None of the rows are locked. B.The retrieved rows are locked. C.The last row of the result set is locked. D.The rows not previously updated by another application are locked.
ther r 2 tables OTTABLE & SALTABLE, add the otamt from OTTABLE to empsal of SALTABLE if eid is matched else add the unmatched from OTTABLE to SALTABLE
Is db2 a mainframe database?
What is db2 optimizer?
What does DSNDB07 database do?