Re: JSON path query returns duplicate values

Поиск
Список
Период
Сортировка
От Thomas Kellerer
Тема Re: JSON path query returns duplicate values
Дата
Msg-id 9c68a03b-f9f1-a21f-3ee7-a0c1162e6b08@gmx.net
обсуждение исходный текст
Ответ на JSON path query returns duplicate values  (Thomas Kellerer <shammat@gmx.net>)
Список pgsql-sql
Thomas Kellerer schrieb am 21.12.2020 um 10:43:
> I wonder why this query
>
>    select jsonb_path_query_array(col, '$.**.itemName')
>    from (
>      values ('{"items": [{"itemName": "a", "items": [{"itemName": "b"}]}]}'::jsonb)
>    ) as t(col)
>
> returns each itemName twice: ["a", "a", "b", "b"]
>
> I would have expected: ["a", "b"]

Is this a bug or intended?

If it's intended, I would really like to know the reason.
At least to me the result is quite surprsing.




В списке pgsql-sql по дате отправления:

Предыдущее
От: Thomas Kellerer
Дата:
Сообщение: JSON path query returns duplicate values
Следующее
От: Sachin Kumar
Дата:
Сообщение: how to make query