I would like to get the count of all products under a certain id.
I tried:
SELECT
count(jsonb_object_keys(data #> '{products}')) as numProducts
FROM
appointment_intakes
WHERE
appointment_intakes.id = 'VGDKMjdxn'
I get:
ERROR: set-valued function called in context that cannot accept a set
When I run the above without the count function, I get a list of keys.
Any idea what I am doing wrong?
Thank you.
select countin Postgres... Usually it would be something likeSelect count(*)..