mysql - sql query for product taging to get product having 3 specific tag -
i have database design having 3 table below:
products pid pname pprice tags tag_id tag_name products_tag ==> unique(pid,tag_id) pid tag_id 65 1 65 3 66 2 88 2 88 4 88 3
i have requirement pid have tagid = 2 , 3 , 4. result in case 88(pid). sql query problem statement?
select pid products_tag tagid in (2,3,4) group pid having count(tagid) = 3
Comments
Post a Comment