I'm trying to create a query where it extracts the country only from a column. The column looks as follow.
Label:
456.United_States.NYC
4589.United_States
789.United_States.NYC.Manhattan_Level
506.India.Bangladesh_3
CodePudding user response:
You can use split_part()
SELECT
split_part(my_column, '.', 2) as country
FROM mytable