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