Table categories:
id, name,
-------------
1 category1
2 category2
3 category3
4 category4
Table posts:
id, category, title
--------------------
1 1, 3 title1
2 4, 2 title2
3 1, 4 title3
I would like to have a show categories and counter posts in this category. In the category column in the table posts I IDs of categories, which are separated by ', '. How to do that is searched when category = category ID and show counter with a minimum of SQL queries.