select - Difficult SQL Request? -
i have table tagmusic
id tagid musicid --------------------- 1 1 141 2 4 141 3 3 102
so need say: take me music id have tag id 1 , 4 (for example ).
one way select tags , count how many unique results got per tag:
select musicid tagmusic tagid in (1, 4) group musicid having count(*) = 2
Comments
Post a Comment