tsql - How can I SELECT where there is a specific link in a linking table or there is no link? -
I have two tables:
video --------- - ---- VideoID VideoGroup ID User ID
and
VideoTag -------------- Video ID Tag ID
I want to select all video group ID where producer is 1, 2 or 3 and there are 10 or 11 or 12 videos or videos attached or there are no tags related to the video. . Can I do it in the same question?
I think you want to join a left with an empty probe
Select VEE from V. videogrouped video. Videvideoid = vt.videoid at v.te.videoid where v.creatoruserid (1, 2, 3) and (vt.tagid is empty or vt .tagid in (10, 11, 12))
Comments
Post a Comment