Select … where … OR

后端 未结 7 971
误落风尘
误落风尘 2021-02-05 09:09

Is there a way to select data where any one of multiple conditions occur on the same field?

Example: I would typically write a statement such as:

select          


        
7条回答
  •  失恋的感觉
    2021-02-05 09:20

    select * from TABLE where field IN (1,2,3)
    

    You can also conveniently combine this with a subquery that only returns one field:

        select * from TABLE where field IN (SELECT boom FROM anotherTable)
    

提交回复
热议问题