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

How to get nth highest salary from table in a mysql?

519


why not null is not allowed at table level

2282


How to use regular expression in pattern match conditions?

513


Why mongodb is faster than mysql?

461


What are triggers mysql?

473






How to convert character strings to dates?

523


Explain the difference between mysql_fetch_array(), mysql_fetch_object()?

453


Which is better mysql or microsoft sql?

431


What is unsigned int in mysql?

483


What is difference between mysql and mariadb?

478


How do I connect to a mysql database?

481


How do you restart mysql?

473


Where’s database data actually stored? Is there a way to see the files which are stored?

497


How to extract a unit value from a date and time?

482


What is meant by mysqli?

485