SQL query: Simulating an “AND” over several rows instead of sub-querying

后端 未结 5 1150
轮回少年
轮回少年 2020-11-29 08:07

Suppose I have a \"tags\" table with two columns: tagid and contentid. Each row represents a tag assigned to a piece of content. I want a

5条回答
  •  遥遥无期
    2020-11-29 08:25

    What type of SQL? MS SQL Server, Oracle, MySQL?

    In SQL Server doesn't this equate to:

    select contentid from tags where tagid IN (334,338,342)
    

提交回复
热议问题