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

What is mdb stand for?

1057


Is sql scripting language?

1113


What are sql functions? Describe the different types of sql functions?

1210


What is rank dense_rank and partition in sql?

1084


What is relationship? How many types of relationship are there?

1262


define data blocks ? : Sql dba

1045


What is sql comments?

1116


Enlist the advantages of sql.

1052


What is the current version of postgresql?

1127


How long does it take to learn pl sql?

1103


The select into statement is most often used to create backup copies of tables or for archiving records?

1115


Which are the different case manipulation functions in sql?

1075


What do you mean by query optimization?

1050


Can we rollback after truncate?

1072


What is natural join in sql?

1044