This might sound little stupid but i don't have much experience in Mysql and database related things.
I have a table named posts and it has a field (Tags). Below is the sample data.
ID, Title, Tags
1 Friend Title Friend, School, City
2 College College, City
3 Work Work, City, Friend
Tags are comma separated.
I need to get the count of these tags. I am Expecting
School - 1
City - 3
College - 1
Work - 1
something like this.
I know before asking the question we need to show some code or query but i don't know where to start. I am not looking for complete solution.
Just guide me what to use then i will try.
Edit As advised by Forpas i have anohter table which contains the name of the tags. That looks like below.
Tagid Tag active
1 School 0
2 College 0
3 City 0
4 Home 0
5 Hotel 0