I have 3 table in mysql database like following
table 1 : videos
id name
1 one
2 two
3 three
table 2: tags
id name
1 stage=test
2 age=under18
table 3 : tags_to_items where tags_id
= tags.id
and item_id
=videos.id
tag_id item_id
1 1
2 2
2 1
1 3
Here item_id 1
has 2 tags.
I want to select all the records from videos
table where tag_id=1
and tag_id=2
. So output should be video.id=1
.
Please help me to do like that, thanks in advance.