Relative Content

Tag Archive for sqlstringparsingsplitdelimiter

SQL to parse very long string into many columns

How to use base SQL to parse a very, very long string into many columns by a delimiter?
I’ve been through a few posts (here for example, and here or here) on parsing into separate columns, rows, et cetera. They all however seem to manually identify and create each column. (Here, for example, the example includes three columns, the maximum number needed). I need up to 90 columns. I’m looking for a way to consolidate, or functionalize, the parsing into multiple columns so I don’t need to repeat the equivalent of ‘,nullif(split_part(my_string,’|’,N),”) string_N’ from below 90 times.