开发者

I want a db2 query to which satisfy the following condition

I have requirement to fetch all the rows which have value in some column like d'souza or in the form of something'something i tried using a like query as '[a-zA-Z]''%' but its not working.开发者_C百科 please need your help


Try LIKE with '%''%'

Sadly SQL's LIKE statement doesn't offer advanced RegEx functionality (Though that might be different for db2). But after you've filtered your results like that, you can do the fine-grained checking by using a script or as part of your application.

[EDIT] As you wrote that you have restrictions regarding the % sign at the beginning of the statement you could try something complicated like:

'a''%' OR 'b''%' OR ... 'A''%' OR 'B''%' ...

Not very beautiful code, but effective.


I hope this is what you are looking for .kindly read the post.

DB2 database, regexp is not supported (without additional libraries).

Emulate REGEXP like behaviour in SQL

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜