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?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / bashi
SELECT sitename, COUNT(*) AS NumOccurrences
FROM tbl_sites
GROUP BY sitename HAVING COUNT(*) > 1
| Is This Answer Correct ? | 0 Yes | 1 No |
Answer / sriram
SELECT sitename,COUNT(sitename) FROM tbl_sites GROUP BY
sitename
| Is This Answer Correct ? | 5 Yes | 7 No |
Answer / thilip
SELECT sitename,COUNT(sitename) FROM tbl_sites GROUP BY
sitename
| Is This Answer Correct ? | 2 Yes | 5 No |
How many ways we can we find the current date using MySQL?
What is the current version of mysql?
What are the steps involved in query processing?
What are the differences between MySQL_fetch_array(), MySQL_fetch_object(), MySQL_fetch_row()?
why we are join a tow table
What is default password for mysql?
What is mysql procedure?
What is the difference between MyISAM Static and MyISAM Dynamic?
The structure of table view buyers is as follows: +----------------+-------------+------+-----+---------+----- -----------+ | Field | Type | Null | Key | Default | Extra | +----------------+-------------+------+-----+---------+----- -----------+ | user_pri_id | int(15) | | PRI | NULL | auto_increment | | userid | varchar(10) | YES | | NULL | | +----------------+-------------+------+-----+---------+----- -----------+ the value of user_pri_id the last row 2345 then What will happen in the following conditions? Condition1: Delete all the rows and insert another row then. What is the starting value for this auto incremented field user_pri_id , Condition2: Delete the last row(having the field value 2345) and insert another row then. What is the value for this auto incremented field user_pri_id
What is data types in mysql?
How MySQL Optimizes DISTINCT?
What is striped backup
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)