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.
精彩评论