You want to use HAVING to filter on the aggregate function.
SELECT name, COUNT(*)
FROM mytable
GROUP BY name
HAVING COUNT(*) > 1
More Related Contents:
- get first occurrence of last changed value of a column [closed]
- MySQL – Rows to Columns
- ROW_NUMBER() in MySQL
- multiple query same table but in different columns mysql
- How can I make SQL case sensitive string comparison on MySQL?
- 1052: Column ‘id’ in field list is ambiguous
- How can I temporarily disable a foreign key constraint in MySQL?
- How to do a batch insert in MySQL
- Count the occurrences of DISTINCT values
- Ordering by the order of values in a SQL IN() clause
- Creating a “Numbers Table” in MySQL
- SQL Selecting from two Tables with inner join and limit [duplicate]
- MySQL Group by SUM
- Cumulative sum over a set of rows in mysql
- Set NOW() as Default Value for datetime datatype?
- SQL: selecting rows where column value changed from previous row
- Why do results from a SQL query not come back in the order I expect?
- How to generate data in MySQL?
- MySQL combine two columns and add into a new column
- SQL query of multiple values in one cell
- How to skip certain database tables with mysqldump?
- MySQL error 1241: Operand should contain 1 column(s)
- How to set a MySQL row to READ-ONLY?
- Mysql: Order by like?
- Getting first day of the week in MySql using Week No
- How to format number with “.” as thousands separator and “,” as decimal separator?
- Using DISTINCT and COUNT together in a MySQL Query
- SQL date format convert? [dd.mm.yy to YYYY-MM-DD]
- Convert SQL Server query to MySQL [duplicate]
- comparison of truncate vs delete in mysql/sqlserver [duplicate]