I need to split a string into two based on a character and I need to do this without using
CodePudding user response:
Consider below approach
select
arr[offset(0)] as splitstring1,
arr[safe_offset(1)] as splitstring2
from your_table,
unnest([struct(regexp_extract_all(string, r'[^=] ') as arr)])
if applied to sample data in your question - output is