Skip to content
Advertisement

Tag: json

SQL Insert JSON into table column

while searching for a way to insert array into single db columns, I found an article about inserting JSON string. However it wasn’t explained how. I tried to search and find the way with no success. I have the following table: What i want to do is insert a Json arry in the address column. like: I thought about inserting

how to use wildcard for a column jsonb type

I have a table (named profile) in my Postgres database, which has 3 columns: ID, Day, Ftfm_profile of type jsonb, I tried to extract the row where the profile name (ftfm_profile->’name’) begins with ‘LFBB’ ( sql: LFBB%) using the wildcard as following: the expected result: I can’t seem to find the solution, thanks for your help Answer One option unnests

MySQL use JSON_CONTAINS with a subquery

I’m trying to make a subquery inside JSON_CONTAINS to have a results like this This is what I have tried But since the subery query returns Client instead of “Client” JSON_CONTAINS doesn’t accept the value. ERROR 3141 (22032): Invalid JSON text in argument 1 to function json_contains: “Invalid value.” at position 0. Answer You could just concat the double quotes

Update partial jsonb field in Postgres 13

can anyone help please optimize SQL request Postgres 13 (jsonb). Need to update the “percent” values inside the Jsonb field with the specified ID This example is working, but it works for a very long time on a large database. https://dbfiddle.uk/?rdbms=postgres_13&fiddle=a521fee551f2cdf8b189ef0c0191b730 Answer I would phrase this as: The logic is quite the same as in your original code, but this

Advertisement