SQL Server using wildcard within IN

前端 未结 13 824
终归单人心
终归单人心 2020-12-02 20:07

Since I believe this should be a basic question I know this question has probably been asked, but I am unable to find it. I\'m probably about to earn my Peer Pressure badge,

13条回答
  •  庸人自扰
    2020-12-02 20:49

    As Jeremy Smith posted it, i'll recap, since I couldn't answer to that particular question of his.

    select *
    from jobdetails
    where job_no like '071[1-2]%'
    

    If you just need 0711% and 0712% you can also place a ranges within the brackets. For the NOT keyword you could also use [^1-2]%

提交回复
热议问题