I have a table with column. one column is json - "session". The json is not nested. If I want to make the key of the json as new column name, how can I do that easily? The json is big, so is there something dynamic? without specifying each key in the json? I found only solution that return me key-value pairs but I want it on more relational style.
example:
User_name | Is active | Session
Kate yes {"session_id": 34386384,
"platform: Jha,
"last_login": 12/2/97}
I want it to be:
User_name | Is active | session_id | platform | last_login
Kate yes 34386384 Jha 12/2/97
what i tried:
with cte as (
select
from user_sessions
,lateral flatten(input => Session)
)
select *
from cte