I have data table which contains fields "id, title, post_data,tag(comma separated)" and tag_name table which contains id,tag.
Now I need to find most relevant topic for a particular post by using the tag, Which is having more similar tags.
Why are the posts tags in a comma separated list as opposed to a separate table that relates a tag to a post?
Because I want to display cloud tag like in wordpress... For that I need the tag name and number of post mentioning the tag.
Normalize your database by eliminating the column with comma separated values, and create a new table (posttags) instead (like oddz says). That new table will contain a row for each post-tag couple.