Skip to content
Advertisement

How to extract values from array json column into multiple rows in Postgresql?

How can I extract values from the json arrays in ranges column as multiple rows Postgresq?

Expected result:

Start End
1 100
101 1000
1001 2000
2001 2002

Advertisement

Answer

You can use jsonb_to_recordset function for this :

http://www.sqlfiddle.com/#!17/22d62/10

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement