how to get duplicate records from tables?write qurey for this?
Answers were Sorted based on User's Feedback
Answer / anshuman
Select column_name1,column_name2
from table_T
group by column_name1 having count(*)>1
it will give all the duplicates value of column_name1
| Is This Answer Correct ? | 28 Yes | 7 No |
Answer / mahesh babu
select column_name,count(*) from table_name group by
column_name having count>1.
| Is This Answer Correct ? | 6 Yes | 2 No |
Answer / naresh k
select * from table_name;
The above qurey get duplicate record also because the
database store records like multi-set..
if we want get distinct records then use following query.
select distinct(attribute_name) from table name
| Is This Answer Correct ? | 0 Yes | 15 No |
Answer / pandu
To get the duplicate records in a table use the query
Select distinct(deptno) from emp;
reply any one to me am i correct.
| Is This Answer Correct ? | 2 Yes | 26 No |
What is referential integrity?
What r the comman abends in db2, jcl and cobol???????
What is a subselect? Is it different from a nested select?
Suppose pgm A calling Pgm B .Pgm B has some Db2 program. at the time of compilation should plan and package will be created for both A and B or only B? What is the concept?
Do we need cursor for Count(*)?
How can you do the explain of a dynamic sql statement?
Generally if I want to select the names starting with c I need to use c% But how could I code to select the data which contains % as a part of data.
can I alter a table (e.g. adding a column) when other user is selecting some columns or updating some columns from the same table?
File not opened because library is *PROD and debug is UPDPROD(*NO). ? what may be the reason? how to solve it..?
What is dpf in db2?
Plan has the optimized access path in it. But is that optimized access path is attained or known
How do I handle -911 (deadlock) error in a db2 program so that the program will never abend?