MySQL LIKE IN()?

后端 未结 11 1718
时光说笑
时光说笑 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条回答
  •  旧时难觅i
    2020-11-22 05:50

    You can get desired result with help of Regular Expressions.

    SELECT fiberbox from fiberbox where fiberbox REGEXP '[1740|1938|1940]';
    

    We can test the above query please click SQL fiddle

    SELECT fiberbox from fiberbox where fiberbox REGEXP '[174019381940]';
    

    We can test the above query please click SQL fiddle

提交回复
热议问题