开发者

How to write this particular query?

How to handle two condition on a single column ? Suppose my query is like

SELECT * FROM mytable WHERE id = 'aa' AND ( title REGEXP 'foo' OR branch REGEXP 'bar') 

I want to put condition on title that it shoud not be of the pattern "test - /开发者_运维问答/ followed by any thing". Thanks in advance.


Use NOT LIKE:

SELECT *
FROM mytable
WHERE title NOT LIKE 'test - %'
-- AND etc....
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜