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 are the contents of a dclmgen?
What can the Locate option of the Repair Utility accomplish?
what is parm utility
If a table has a column "dept" (declared to have nulls) and there are 10 rows in the table of which 3 have a null value in the dept column, what will select count(*) and select count(distinct dept) return?
Why do we need to create an alias if we can directly use the table name? What are the benefits of referring a table name by its alias? Also, when should we go for alias and when for synonyms?
My cobol program(not having any sql statements) is calling another cobol program ( having sql statements), what is needed for compilation and run in jcls .
What's The Percentage Free Space ?
Where is the access path logic created by the DB2 Optimizer stored?
Are view updateable?
how to resolve -811 sqlcode .give clear explaination
What if , we failed to mentioed null indicator in sql select query , that may retrieve null value ?
How do you select a row using indexes in db2?