开发者

Mysql Select String Function Problem

开发者 https://www.devze.com 2023-01-20 08:34 出处:网络
I want to select rec开发者_StackOverflow中文版ords in my table when it matches a row that ends with a particular value.

I want to select rec开发者_StackOverflow中文版ords in my table when it matches a row that ends with a particular value.

eg.

if 'oop' is found at the end of a particular record it select the record

Pls how can i go about it

thanks


You can use LIKE:

SELECT *
FROM your_table
WHERE your_column LIKE '%oop'

Note that this query will result in a full scan so it might be slow if you have many rows.


select * from yourtable where somevalue like '%oop'


SELECT *
FROM your_table
WHERE your_column REGEXP 'oop'

Regular Expression Queries can open up some pretty cool extra features that like can't touch.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号