When items is not an array

When items is not an array

In purchase-event parcels, items normally holds an array of order lines. The data is messy, though, and QUERY, the archive AI mentor, wants the events where the key exists but contains something else. What to return: - event_id — the event ID - items_type — the type of the items value Keep in mind: - the operator payload -> 'items' fetches the value of a key - jsonb_typeof names the value type - consider any events - include only events where the items key is present but its value is not an array - skip events that have no items key at all Sort by event_id ascending.

A ordem das linhas importa

PostgreSQLv16
Entre para enviar

O resultado da sua consulta aparecerá aqui

Focus radio
Paused · SomaFM · Fluid