开发者

Mysql Select String Function Problem

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜