The table tbl_sites contains the following data:
-----------------------------------------------------
Userid sitename country
------------------------------------------------------
1 sureshbabu indian
2 PHPprogrammer andhra
3 PHP.net usa
4 PHPtalk.com germany
5 MySQL.com usa
6 sureshbabu canada
7 PHPbuddy.com pakistan
8. PHPtalk.com austria
9. PHPfreaks.com sourthafrica
10. PHPsupport.net russia
11. sureshbabu australia
12. sureshbabu nepal
13. PHPtalk.com italy
Write a select query that will displayed the duplicated
site name and how many times it is duplicated?

Answer Posted / dinesh goyal, scorpio

select sitename,count(sitename) as total_sites from
tbl_sites group by sitename having (count(sitename)>1)

Is This Answer Correct ?    22 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the different data types in mysql?

474


How to insert dynamic values in mysql using php?

539


Why should I learn mysql?

490


What is mysql aggregate functions? Explain

532


Why mysql is open source?

492






Which storage engine is best in mysql?

478


How do I start mysql in mysql workbench?

517


How to escape special characters in sql statements?

529


Which is faster innodb or myisam?

514


How do I stop a mysql command?

487


How to update database permissions/privilages.

540


What language is used in mysql?

510


What is difference between mysql and mariadb?

489


Can mysql handle big data?

528


How you will Show unique records.

548