2021-08-30

MySQL - CSV field to rows

 select

    t.*,

    j.`single_value`

from

    database_name.`table_name` as t

    inner join

    json_table(

        json_array(t.`csv_source_field_name`)

        '$[*]

            columns (

                `single_value` varchar(50)

                path '$'

            )

    ) as j

;


No comments:

Post a Comment