Reputation: 105
I've a situation where some special characters entered into a column.
For Example:- "Special Character – Standard".
The column legal values contains Alphabets and hyphen - symbol.
Any Help?
I am not able to get them through Equality operator.
Thanks
Upvotes: 0
Views: 13433
Reputation: 3315
something like in below query.
[ ] in below query means any value place in that square baracets
A-Z means any aplhabet between A and Z
- is your - values as - has special meaning, it has to be escaped by \
^ in [ ] means it should not have any of the above mentioned value. This gives all your special character values (as defined by you)
i is for ignorecase
= 1 means true
.* means your variable may have other value along with special character values.
This query gives all the values where column you are interested
SELECT * FROM yourtable WHERE REGEXP_SIMILAR(columnname, '.*[^A-Z\-]+.*', 'i') = 1;
Upvotes: 1