skip to Main Content

Postgresql – Extract values from multiple nested arrays in a JSONB column

I'm currently working on a PostgreSQL query to extract specific values from a JSONB column. Here's the query I'm using: select a.id, (jsonb_array_elements(a.info->'attribute1')->>'value') as attribute1, (a.info->>'attribute2') as attribute2, (a.info->>'attribute3') as attribute3, (jsonb_array_elements(a.info->'attribute4')->>'value') as attribute4 from a_table a where (cast(a.info->>'attribute3' as…

VIEW QUESTION

Optimizing MySQL query with group_concat

I have an old PHP5 MySQL webapp whose code had to be adapted to PHP8/MySQL14.14 There's a view, querying few tables and based on that code: (SELECT `db_demandes`.`bdd`.`id` AS `Id`, `db_demandes`.`bdd`.`ref` AS `Ref`, `db_demandes`.`bdd`.`nodossier` AS `NoDossier`, `db_demandes`.`bdd`.`agentfirme` AS `Agentfirme`, `db_demandes`.`bdd`.`agentanterieur`…

VIEW QUESTION
Back To Top
Search