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...


What is the Query to print out the individual total number of
duplicate row in sql.

Answers were Sorted based on User's Feedback



What is the Query to print out the individual total number of duplicate row in sql...

Answer / girija.112

ANS:

SELECT department_id,COUNT(department_id) AS "Occurrences"
FROM departments
GROUP BY department_id
HAVING ( COUNT(department_id) > 1 )

DEPARTMENT_ID Occurrences
------------- -----------
80 2
60 3

--In my 'departments' table , i have not assigned department_id column as a "primary key / unique key"

Is This Answer Correct ?    28 Yes 3 No

What is the Query to print out the individual total number of duplicate row in sql...

Answer / raveendran

SQL>select * from a;

A B
---- -------------------------
1 Name
ABC
BCA
fdhgjdshfj

3 Name
ABC
BCA
fdhgjdshfj

2 Name
ABC
BCA
fdhgjdshfj

4 Name
ABC
BCA
fdhgjdshfj

5 asd

A B
---- -------------------------
asd
asd
asdd

6 asd
asd

7 asd asd
8 asd asd

sql>select count(b),b from a group by b having count(b)>=1;

T(B) B
---- -------------------------
4 Name
ABC
BCA
fdhgjdshfj

1 asd
asd

1 asd
asd
asd
asdd

2 asd asd

Is This Answer Correct ?    3 Yes 0 No

What is the Query to print out the individual total number of duplicate row in sql...

Answer / vivek ghorad

SELECT * FROM emp WHERE ROWID NOT IN(SELECT MIN(ROWID)FROM
emp GROUP BY empno,fname,dept);

Is This Answer Correct ?    3 Yes 6 No

What is the Query to print out the individual total number of duplicate row in sql...

Answer / ashish bakal

select count(deptno), deptno from emp where rowid not in
(select min(rowid) from emp group by deptno) group by
deptno;

Is This Answer Correct ?    0 Yes 3 No

What is the Query to print out the individual total number of duplicate row in sql...

Answer / ahmad

SELECT DISTINCT(ENAME) FROM EMP;

Is This Answer Correct ?    1 Yes 24 No

Post New Answer

More SQL PLSQL Interview Questions

what is the difference between union and union all? : Sql dba

0 Answers  


what are the advantages and disadvantages of views in a database? : Sql dba

0 Answers  


How to create a menu in sqlplus or pl/sql?

0 Answers  


Explain the uses of a database trigger?

0 Answers  


What are the uses of sysdate and user keywords?

0 Answers  


What is difference between TRUNCATE & DELETE?

16 Answers   Ahn Infotech, CitiGroup, ICICI, PreVator, Saama Tech, SkyTech, TCS,


What can I use instead of union in sql?

0 Answers  


What are tuples in sql?

0 Answers  


Difference between inline query and stored procedure?

4 Answers   Bharat, Microsoft,


Why partition by is used in sql?

0 Answers  


I want to know the difference between A Record Type and a Table.

3 Answers   Thermotech,


What is #table in sql?

0 Answers  


Categories