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 to retrieve Duplicate Rows only in a Table?
Suppose if a Table Name is "Education". It consists of
multiple columns. Then if we insert rows into this table
with duplicate records then how can we retrieve only
duplicate records from that table?

Answers were Sorted based on User's Feedback



How to retrieve Duplicate Rows only in a Table? Suppose if a Table Name is "Education". ..

Answer / lakshmi narayana

select * from emp a ,
(select empno,count(*) from emp group by empno having count
(*) > 1) b
where a.empno = b.empno

Is This Answer Correct ?    27 Yes 10 No

How to retrieve Duplicate Rows only in a Table? Suppose if a Table Name is "Education". ..

Answer / kalaiselvan.j

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

Is This Answer Correct ?    14 Yes 0 No

How to retrieve Duplicate Rows only in a Table? Suppose if a Table Name is "Education". ..

Answer / smita

select a.empno, a.empname from education a,
(select empno, count(*) cnt from education group by empno
having count(*) > 1) b
where a.empno = b.empno

is the correct answer

Is This Answer Correct ?    12 Yes 5 No

How to retrieve Duplicate Rows only in a Table? Suppose if a Table Name is "Education". ..

Answer / cesar di sanctis

select * from <table_name>
where <column_name> in
(select <column_name>
from <table_name>
group by <column_name>
having count(*) > 1)

Is This Answer Correct ?    6 Yes 0 No

How to retrieve Duplicate Rows only in a Table? Suppose if a Table Name is "Education". ..

Answer / lakshmi

In the above query we have to add distinct before *. Else
duplicate rows will be fetched twice.

Thanks,
Lakshmi

Is This Answer Correct ?    9 Yes 4 No

How to retrieve Duplicate Rows only in a Table? Suppose if a Table Name is "Education". ..

Answer / seshu

SELECT RNO,NAME,COUNT(*) REP_COL FROM Education GROUP BY
RNO,NAME having Count(*)>1;

Is This Answer Correct ?    7 Yes 3 No

How to retrieve Duplicate Rows only in a Table? Suppose if a Table Name is "Education". ..

Answer / amit

select * from taruntest1 b where rowid not in (select min
(rowid) from taruntest1 a where a.a=b.a );

Is This Answer Correct ?    8 Yes 5 No

How to retrieve Duplicate Rows only in a Table? Suppose if a Table Name is "Education". ..

Answer / balaji

For Sample:
----------

select count(pmid) as Occurances,pmid from tablename group
by pmid having count(pmid)>1

Is This Answer Correct ?    7 Yes 5 No

How to retrieve Duplicate Rows only in a Table? Suppose if a Table Name is "Education". ..

Answer / rajesh kumar patnaik

SELECT ProductName
FROM Products
WHERE (ProductName IN
(SELECT ProductName
FROM Products
GROUP BY ProductName
HAVING COUNT(*) > 1))

Is This Answer Correct ?    8 Yes 6 No

How to retrieve Duplicate Rows only in a Table? Suppose if a Table Name is "Education". ..

Answer / aravind

select SPAN_UUID, SPAN_UNIT_UUID, count(*) from
SPAN_SPAN_UNIT group by SPAN_UUID, SPAN_UNIT_UUID having
count(*) > 1;

Is This Answer Correct ?    4 Yes 2 No

Post New Answer

More SQL PLSQL Interview Questions

Can 2 queries be executed simultaneously in a distributed database system?

0 Answers  


Why do we need cursor in pl sql?

0 Answers  


write a query to find 4th max salary

7 Answers  


What is sql character function?

0 Answers  


Can we declare a column having number data type and its scale is larger than pricesionex: column_name number(10,100),column_name numbaer(10,-84)

0 Answers  


What is a primary key? Explain

0 Answers  


----> There is a table T with two columns C1 and C2. The data is as below: C1 C2 1 4 2 5 3 6

4 Answers   ICICI,


how to check the 3rd max salary from an employee table?

23 Answers   IBM,


What is difference sql and mysql?

0 Answers  


how do you control the max size of a heap table? : Sql dba

0 Answers  


What are the various restrictions imposed on view in terms of dml?

0 Answers  


What is program debugging?

0 Answers  


Categories