How to select the duplicate rows from a table?
Answers were Sorted based on User's Feedback
Answer / channabasappa
select field name from tablename where group by field name
having count(field name)>1;
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / mahesh vasudevan
Select <col-name> from table A1 and A2
where A1.Col = A2.Col.
This should be an inner join. Then you are finding the
intersection of the key values...if you want to find the
duplicates for all matching column of the rows code AND
condition for join with all those columns.....by the way
there are different easy ways to find it. but this is one of
the way.
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / pandu
select distinct from <field name> from <table name>
| Is This Answer Correct ? | 0 Yes | 3 No |
What technique is used to retrieve data from more than one table in a single SQL statement?
if any of the column names is provided wrong, where do you get the error(during precompilation or during Bind)
What are foreign keys?
what are the frequent DB2 abends did you encounter in your programs ?? What are different SQL abends ??
we can code COPY DCLGEN or INCLUDE DCLGEN, At which stage of the precompilation , dclgen get expanded if we write 1) copy 2) include one question about dclgen.. Is it mandatory to use declare table in dclgen.. I think no...but it will be used by the precompiler to validate the table name,column name etc.., can one clear my doubt ..is it necessary to include declare table or not?
What is meant by index cardinality?
Is Cursor exicutable ?
Which isolation level provides highest data integrity?
Following a db2 update statement, what is the quickest way to compute the total number of updated rows?
I have a subprogram B calling from mainprogram A.I have opened a cursor in A ,Can i fetch the same cursor in subprogram B , If yes , Please explain the reason?
What is a trigger in the db2 database?
What is a lock?