Let's say I have the following tables:
TAGS
id: integer
name: string
POSTS
id: integer
body: text
TAGGINGS
id: integer
tag_id: integer
post_id: integer
How would I go about writing a query that selects all posts in order of the post containing the highest number of the following tags (name attribute of tags table): "Cheese", "Wine", "Paris", "Frace", "City", "Scenic", "Art"
See also: http://stackoverflow.com/questions/3876240/need-help-with-sql-query-involving-tagging (note: similar, but not a duplicate!)