0
I have a real estate table in Mysql divided into 6 categories. I want to make a query that returns the number of records for each category. The only way I know so far is to make a query for each category, but I think it requires a lot of server. Is it possible to make a single query and then find a way to show the results separated by category? Ah, as there are only 6 fixed categories, I have not created another table only of categories, dispensing with the use of Join.
SELECT category , COUNT(category) AS totalCount FROM tableName GROUP BY category
– user60252