SQL Find & Replace part of a string

后端 未结 2 2014
失恋的感觉
失恋的感觉 2021-01-22 02:51

I\'m trying to find certain text \"catid=18\" in a string, where each string is different except for this. I\'ve used this query below before, except it only seems to work if yo

2条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-22 03:22

    Not sure if that is what you want. But it will return 1 if catid=any_num is found and 0 if not:

    select 'some_text catid=18 some_text' REGEXP 'catid=[0-9]+'
    

提交回复
热议问题