Split a value based on a separator and create rows from the resulting split values

The function SPLIT_TO_TABLE is kind of a niche function in Snowflake, but it can work wonders for some specific use cases.

Take a look at the screenshot below to see how it works. Have you ever used this function and if so, what problem were you trying to tackle?

SQL
-- Functie SPLIT_TO_TABLE om data te splitten obv een separator
select
    '1,2,3,4',
    *
from table(split_to_table('1,2,3,4', ','))
;
SQL