0
votes

I have a problem with my Google BigQuery using Split. I have a column named Account like:

"E-mail UK"    
"Shopping New Zealand"
"Shopping South Africa"

I need to split the country from Account. I used the below syntax

SPLIT(Account,' ')[OFFSET(1)]

but it gives the result like:

Country    
Uk    
New    
South

How can I get all the whole string after the first space in Google BigQuery?

Many thanks

2

2 Answers

2
votes

Regular expressions:

REGEXP_REPLACE (account, r'^[^ ]* ', '')
2
votes

get all the whole string after the first space

Alternative option is:

BigQuery Standard SQL

SUBSTR(Account, STRPOS(Account, ' '))    

BigQuery Legacy SQL

SUBSTR(Account, INSTR(Account, ' '))