Skip to content
Advertisement

Select rows from a table which contains at-least one alphabet in the column

I have column called name under a table in Databricks.

I want to find a way to select only those rows from a table, which contains at-least one alphabet character in the name column.

Example values in the column:

Expected: I need to pick only those values which contains at least one alphabet in it. Or in other words, I need a way to exclude all the rows which contains only numbers and special characters.

So the Expected output should be as below :

because these contains at least one alphabet in them.

I am using pyspark-sql in data bricks.

Advertisement

Answer

You can use rlike with regex:

Spark SQL equivalent query:

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement