Reputation: 227
The data contains a column 'product_name' with data type string. It has strings having letters, alphanumeric strings, and numeric strings. I want to exclude the numeric string records and include all others. Below is an example-
product_name
cell phone
Headphones
12356
ABC56TV
2345
Expected Result-
product_name
cell phone
Headphones
ABC56TV
How to fetch this result?
Upvotes: 0
Views: 543
Reputation: 1271241
You can use regexp_contains()
:
select t.*
from t
where not regexp_contains(product, '^[0-9]+$');
This matches something that is not all digits.
Upvotes: 4