SQL for applying conditions to multiple rows in a join

前端 未结 11 2047
一个人的身影
一个人的身影 2020-11-29 22:55

I think I found the answer to my question, I\'m just unsure of the syntax, I keep getting SQL errors.

Basically, I want to do the opposite of IN. Take this example:<

11条回答
  •  日久生厌
    2020-11-29 23:10

    What about

    SELECT * FROM users, tags WHERE tags.user_id = users.user_id AND tags.name = 'tag1'
    INTERSECT
    SELECT * FROM users, tags WHERE tags.user_id = users.user_id AND tags.name = 'tag2'
    

提交回复
热议问题