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 |
List down the data types in the db2 database.
what is dynamic cursor?gives syntax for this?
List out the data types available.
by using cursors , we can access particular records from the table based on some condition, i want to delete those selected records, how can we write a query for this in the program?
How do you declare a host variable (in COBOL) for an attribute named emp-name of type VARCHAR(25) ?
What is collection in db2 bind?
What is meant by concurrency?
i hav created a program and moved to production but failed to create the table which is been used in the program. the program shows error as soon as it is moved or installed in production or shows error during its runtime. what is the sqlcode for this error
what is difference between Static call and Dynamic call? How does it function?
What is a LIKE table and how is it created?
Plan is an executable form of sql statements,But what exactly resides inside a Plan. what are the details inside Plan.
what is a plan and how do you refer the plan in the program?