Skip to content
Advertisement

Tag: json

How to query Json field so the keys are the column names and the values are the column fields

PostgreSQL database name is contacts_contact and the column I’m interested in is called “fields” ‘fields’ column looks like this in my database: And a second record: The ‘fields’ column has fields that look like the two JSON data I shared. It is pretty much responses to a survey. Example, {u’Monthly_household_income’: {u’text’: u'< R1500′}, means that the question was “Monthly household

How to deal with JSON column while using GROUP BY

I’m using a query similar to the below one, address is JSON TYPE. But getting below error: I’m trying to get the data of a person who has the max salary for his age and I need to include adress filed which should be JSON So, Is the there any way to achieve this or is this practically possible ?

Postgres Nested JSONB Query

I have a JSONB column, data, in the orders table: I’m trying to select “orders where discount_codes contain a code in codes_array”. I could not figure out how to write this query exactly. I read about the [*] operator but am unsure how to use it in this context. This only searches the first element of discount_codes: This only searches

Advertisement