I am using this
select 'select '
|| (select listagg(distinct 'json_col:'||key::text||'::string'||' as '||key::text, ', ') from GAURAV.PUBLIC.jsondata, lateral flatten(input=>json_col, mode=>'OBJECT'))
|| ' from GAURAV.PUBLIC.jsondata'
but it can't pick keys dynamic
it shows me output like this
I have Multiple json data in a table how to flatten it
