I need to write a query to pull values from a column containing only special characters. I know that the below query would give me all values containing at least one special char but that is not what I need. Can anybody help me please?
SAMPLE DATA -
ORG
^^567
~423
%^&/
329
I need to write a query which will return only %^&/ from the above sample data.
SELECT org
FROM table_A
WHERE org like '%[^a-Z0-9]%'
Try this
SELECT org
FROM table_A
WHERE org Not like '%[a-Z0-9]%'
Demo
SELECT org
FROM (SELECT '1asdasdf' org
UNION
SELECT '$asd#'
UNION
SELECT '$^%$%') a
WHERE org Not Like '%[a-Z0-9]%'
Result: $^%$%
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With