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
Tell us something about heap tables?
Is mysql from oracle?
What is query log in mysql?
What is difference between Sql server and MySql database? It may be silly question but i really dont know.
What is mysqlcommand?
How do I install mysql on windows 10 64 bit?
What is the storage engine for mysql?
What is username in mysql?
How do I show all mysql databases?
What is mysql connector used for?
How to use case expression?
What is heap table in mysql?
Is blocked because of many connection errors unblock with mysqladmin flush hosts?
If we use sum function in mysql, does it return sum of that row or for that column?
explain GROUPBY & HAVING clause with examples.