SELECT
category,
COUNT(*) AS `num`
FROM
posts
GROUP BY
category
More Related Contents:
- Complex Count in MySQL
- Most efficient way to get table row count
- Order by COUNT per value
- 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 to do a batch insert in MySQL
- Count the occurrences of DISTINCT values
- Creating a “Numbers Table” in MySQL
- Why does MySQL allow “group by” queries WITHOUT aggregate functions?
- Cumulative sum over a set of rows in mysql
- Set NOW() as Default Value for datetime datatype?
- Add Auto-Increment ID to existing table?
- MySQL SELECT DISTINCT multiple columns
- SQL DELETE with JOIN another table for WHERE condition
- mysql trigger stored trigger is already used by statement which invoked stored trigger
- MySQL error 1241: Operand should contain 1 column(s)
- How to transpose rows to columns with large amount of the data in BigQuery/SQL?
- Count with IF condition in MySQL query
- Mysql: Order by like?
- Getting first day of the week in MySql using Week No
- Is there a way to get the row number in Mysql like the rownum in oracle [duplicate]
- How to get a list of months between two dates in mysql
- How to format number with “.” as thousands separator and “,” as decimal separator?
- Using DISTINCT and COUNT together in a MySQL Query
- How to check if field is null or empty in MySQL?
- Strip last two characters of a column in MySQL
- DELETE FROM `table` AS `alias` … WHERE `alias`.`column` … why syntax error?
- What happens when I exhaust a bigint generated key? How to handle it?
- is there a length limit to group_concat or another reason why it would not work on a text field