Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


how do you count the duplicate records in a table

Answers were Sorted based on User's Feedback



how do you count the duplicate records in a table..

Answer / priya

select coloumn_name ,count(*) from table_name
group by coloumn_name
having count(*) > 1;

Is This Answer Correct ?    35 Yes 0 No

how do you count the duplicate records in a table..

Answer / babu

Try this,
select col1,count(col1) from tab1
group by col1 having count(col1)>1;

If you want to delete these duplicate entries, use:
delete from tab1 where col1 in (select a.col1 from
(select col1,count(col1) from tab1
group by col1 having count(col1)>1) a);

Is This Answer Correct ?    18 Yes 1 No

how do you count the duplicate records in a table..

Answer / purushotham

select column,count(1) from a
group by column
having count(1)>1;

Is This Answer Correct ?    7 Yes 1 No

how do you count the duplicate records in a table..

Answer / dev

Hi,
There are many ways to do it.

One of that is ,

select count(0) from tab1 a
where a.rowid > any (select b.rowid from tab1 b where
a.col1 =b.col1);

Is This Answer Correct ?    6 Yes 4 No

how do you count the duplicate records in a table..

Answer / akki julak

select count(empno)-count(distinct(empno)) from emp;

Is This Answer Correct ?    3 Yes 2 No

how do you count the duplicate records in a table..

Answer / ajmal khan

There are many way to count the duplicate row in a table
select count(column_name)-count(distinct(column_name)) from
table_name;

Is This Answer Correct ?    1 Yes 0 No

how do you count the duplicate records in a table..

Answer / suresh a

select sum(count(col1) -1) from emp
group by col1 having count(col1) > 1

Is This Answer Correct ?    2 Yes 2 No

how do you count the duplicate records in a table..

Answer / shalu

select count(*) from table_name group by column1,column2...
having count(*) > 1

Is This Answer Correct ?    2 Yes 2 No

how do you count the duplicate records in a table..

Answer / sravan

Hi here is another way to solve this

SELECT NAME, COUNT(NAME) FROM TABLE_NAME
WHERE NAME IN (SELECT NAME FROM TABLE_NAME
GROUP BY NAME
HAVING COUNT(NAME)>1)
GROUP BY NAME;

thanks

Is This Answer Correct ?    0 Yes 0 No

how do you count the duplicate records in a table..

Answer / satheesh

SELECT COUNT(*)
FROM TABLE A
WHERE ROWID NOT IN (SELECT MAX(ROWID)
FROM TABLE B
WHERE A.COL1 = B.COL1);--UNIQUE COLUMN

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL PLSQL Interview Questions

Enlist the advantages of sql.

0 Answers  


What is bulk collect in pl sql?

0 Answers  


What is a full join sql?

0 Answers  


When you have to use a default "rollback to" savepoint of plvlog?

0 Answers  


What is the use of index in sql?

0 Answers  


What programs use sql?

0 Answers  


What is the usage of NVL?

7 Answers   Infosys, Micro Infotek,


What is normalization? dec 2009

3 Answers   Cognizant,


Explain the components of sql?

0 Answers  


how would you enter characters as hex numbers? : Sql dba

0 Answers  


Explain how exception handling is done in advance pl/sql?

0 Answers  


I have a table with 1 million records out of which 10,000 records are of unique records, then if I will implement index, then which type of index shall I use and why shall I use?

2 Answers   HSBC,


Categories