Ritz
Ritz

Reputation: 11

Is there a way to split the variable in different columns

Need help to split the variable in different columns.

The variable has 3 inputs separated by the symbol pipe '|'

The size of the input varies.

Using query : split(x, '|') [0] as abc, split(x, '|') [1] as bcd,

Input field x = 234324234|4873264962 


Required output:
    column 1: abc 234324234 
    column 2: bcd 4873264962

Upvotes: 1

Views: 25

Answers (1)

rightjoin
rightjoin

Reputation: 148

InputField x: 234324234|4873264962

select split(x, '\\|') [0] as col1, split(x, '\\|') [1] as col2, split(x, '\\|') [2] as col3 from table.

col1 col2 col3 234324234 4873264962 NULL

Upvotes: 1

Related Questions