I have the following tables in my database:
tags
id | name
---------
1 | tag1
2 | tag2
3 | tag3
4 | tag4
map_posts_tags
post_id | tag_id
----------------
123 | 1
123 | 2
234 | 1
345 | 3
345 | 4
456 | 2
456 | 1
Is it possible to get all the posts with the same related tags as the passed post_id by using a SQL query?
For example:
I have my post with id 123 and want to get a list of all the posts that have the same tags related (excluding from the list my post with id 123 if possible from SQL).