How to regex in a MySQL query

前端 未结 2 745
-上瘾入骨i
-上瘾入骨i 2020-11-30 23:41

I have a simple task where I need to search a record starting with string characters and a single digit after them. What I\'m trying is this

SELECT trecord          


        
2条回答
  •  伪装坚强ぢ
    2020-12-01 00:08

    I think you can use REGEXP instead of LIKE

    SELECT trecord FROM `tbl` WHERE (trecord REGEXP '^ALA[0-9]')
    

提交回复
热议问题