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 is the total syntax for fetch ? can any one please give me all the details of fetch ? thx
How would the varchar column remarks defined?
How can you compare table column after update and before update?
Explain the use of the WHERE clause?
How do I change the column size in db2?
What is sqlcode -811?
7 Answers Accenture, CTS, TCS,
Can a array declared with an index be displayed(readable format) in spool?
how to execute qcmdexc in rpgle?plz write code also?
Where could you look if you had a question about whether a column has been defined as an index?
How do I delete a table in database?
How to connect to db2 database from windows command line?
a cursor normally gets closed once we provide a commit . If u try to close the same cursor with close cursor command later after providing the commit will there be any sql-error.