PostgreSQL only selects the letters in the column

So I have this column that contains the street address and house number, and they are all stored in the same column.

For example: Boulevard 123

< p>Now I want to separate these letters from numbers, so I get “Boulevard” and “123” respectively through a select statement.

How can I do this with reg expressions?

Thanks in advance

One way is to use regexp_split_to_array

code>Split the value by spaces:

SELECT address_arr[1] AS streer_name, address_arr[2] AS street_number
FROM (SELECT REGEXP_SPLIT_TO_ARRY(address, '') AS address_arr
FROM my_table) t

So I have this column that contains the street address and house number, and they are all stored in the same column.

For example: Boulevard 123

Now I want to separate these letters from numbers, so I get "Boulevard" and "123" respectively through a select statement.

< p>How can I do this with reg expressions?

Thanks in advance

One way is to use regexp_split_to_array to split the value by spaces:

< /p>

SELECT address_arr[1] AS streer_name, address_arr[2] AS street_number
FROM (SELECT REGEXP_SPLIT_TO_ARRY(address, '') AS address_arr
FROM my_table) t

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 740 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.