From: | Gavin Henry <gavin(dot)henry(at)gmail(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | pgsql-novice(at)postgresql(dot)org |
Subject: | Re: JSON query help |
Date: | 2019-08-29 22:01:01 |
Message-ID: | CAA8_NKD9vQTSe8b9fzsUChvWQi6OBgvJLY=oRPTo3TU6QqNiUg@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-novice |
Any pointers for below docs wise? Thanks!
On Thu, 29 Aug 2019 at 00:37, Gavin Henry <gavin(dot)henry(at)gmail(dot)com> wrote:
> Thanks, that worked! Now I need to go back to basics and SETS:
>
> SELECT
>
> cost_details->'Accounting'->jsonb_object_keys(cost_details->'Accounting')->'BalanceUUID'
> AS BalanceUUID,
>
> cost_details->'Accounting'->jsonb_object_keys(cost_details->'Accounting')->'Units'
> AS Cost
> FROM cdrs
> WHERE cost > 0
> AND cost_details->'AccountSummary'->'BalanceSummaries' @>
> '[{"ID":"B_MONETARY_POSTPAID"}]'
> AND cost_details->'AccountSummary'->'BalanceSummaries' @>
> json_build_object('UUID',
>
> cost_details->'Accounting'->jsonb_object_keys(cost_details->'Accounting')->'BalanceUUID')::jsonb
> limit 1;
> ERROR: argument of AND must not return a set
> LINE 1: ...ummaries' @> '[{"ID":"B_MONETARY_POSTPAID"}]' AND cost_detai...
>
--
http://www.suretecsystems.com/services/openldap/
http://www.surevoip.co.uk
From | Date | Subject | |
---|---|---|---|
Next Message | Lætitia Avrot | 2019-08-30 12:07:33 | Re: Anyone recommend omnidb.org? |
Previous Message | Tom Browder | 2019-08-29 11:57:37 | Re: Anyone recommend omnidb.org? |