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.

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you truncate?

891


What is procedure explain with program?

993


What is pl sql block in dbms?

990


what is isam? : Sql dba

985


what is self-join? : Sql dba

1124


Can you call pl/sql package functions from within a fast formula?

1018


Show code of a cursor for loop.

1043


What is the difference between cross join and natural join?

997


What are string functions in sql?

1219


how to analyze tables with 'mysqlcheck'? : Sql dba

993


What are pl sql procedures?

1013


What is sp_helptext?

1051


What is trigger in sql?

1065


What is the use of function "module procedure" in pl/sql?

1182


Is sql a microsoft product?

934