Select … where … OR

后端 未结 7 1248
误落风尘
误落风尘 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:16

    while in is a shortcut for or and I wasn't sure how I could combine in with and, I did it this way

     SELECT * FROM table
     WHERE column1='x' AND (column2='y' OR column2='z');
    

提交回复
热议问题