Skip to content
Advertisement

Select part from the values in SQL

I have such problem/question. I am trying to extract data from database, but only part. The real example is:

I need to receive only 1F5FspmpyfQ, all between {"invoice_id": " and "},.

Advertisement

Answer

You can use Postgres’ JSON functions:

-> returns a json object with the specified key and ->> returns the key’s value as a text (rather than jsonb)

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement