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

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -