MySQL LIKE IN()?

后端 未结 11 1674
时光说笑
时光说笑 2020-11-22 05:31

My current query looks like this:

SELECT * FROM fiberbox f WHERE f.fiberBox LIKE \'%1740 %\' OR f.fiberBox LIKE \'%1938 %\' OR f.fiberBox LIKE \'%1940 %\'
         


        
11条回答
  •  隐瞒了意图╮
    2020-11-22 06:00

    Sorry, there is no operation similar to LIKE IN in mysql.

    If you want to use the LIKE operator without a join, you'll have to do it this way:

    (field LIKE value OR field LIKE value OR field LIKE value)
    

    You know, MySQL will not optimize that query, FYI.

提交回复
热议问题