comparing multiple columns in an exists to filter the parent table

0

Please login or register to vote for this query.

(click on this box to dismiss)

Physics Meta

Q&A about the site for active researchers, academics and students of physics

select * 
from PostTags as pt
where exists 
(
  select * 
  from ( values (9,1),(14,1)) as v (PostId, TagId)
  where 
    pt.PostId = v.PostId and 
    pt.TagId = v.TagId
)

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results