Wildcard in the IN clause

后端 未结 2 1109
野趣味
野趣味 2021-01-18 21:16

SQL: I want use the wildcard \"%\" in the IN clause but I\'m not getting the results I expect. My query is like this

SELECT DISTINCT ID,
              FROM I         


        
2条回答
  •  清酒与你
    2021-01-18 21:42

    You can't do that. IN is for literals, percent signs are for LIKE. Sorry! So WHERE type LIKE 'IP_%_International'. But if you have several patterns , the only thing you can do is to OR them together.WHERE type LIKE 'IP_%_International' OR type LIKE 'some_%_other_pattern'

提交回复
热议问题