Any way to select from MySQL table where a field ends in certain character/number?

后端 未结 7 521
南方客
南方客 2020-12-21 10:57

I am hoping to run a mysql_query where I can select a row if a certain field ends in a number. For example:



        
7条回答
  •  庸人自扰
    2020-12-21 11:35

    You can use LIKE and a wild card expression it should be somthing like

    SELECT id FROM table WHERE id REGEX '%0$'
    SELECT id FROM table WHERE id REGEX '%1$'
    

    and so on.

提交回复
热议问题