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 / bashi

SELECT sitename, COUNT(*) AS NumOccurrences
FROM tbl_sites
GROUP BY sitename HAVING COUNT(*) > 1

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between having and where clause in mysql? Explain

515


What do we use to remove duplicate records while fetching a data in mysql ?

495


How large can a mysql database become?

464


How to create trigger in mysql phpmyadmin?

495


Does mysql support nosql?

452






how to get only updated, deleted , inserted records after certain interval time in mysql with out using triggers...

1789


What is delimiter in mysql trigger?

504


What is a storage engine? What are the differences between innodb and myisam engines?

496


How to check if value already exists in mysql database in php?

426


How to define numeric 9(3) in db2 table without decimal point??

2371


Consider you have the following three tables which have to be linked together.

478


Where is the mysql database stored?

456


What are the two types of queries?

428


What are triggers mysql?

465


Is mysql a database?

469