PostgreSQL: Is it possible to use the result of a subquery into a jsonb?
I have a query that gets some data, for example: select type_of_client from table1; type_of_client -------------- restaurant bar cinema ... And I would like to use these results into a jsonb element, for example: select count(*) from table2 where fields->>'restaurant'…