Skip to content

Tag: json

Mysql Json extract with conditional filter

I’m trying to query some json data through a filter. Given a json array like this: I’d like to select all the rows which have as country name ‘France’ and a value greater than 10 as ‘people’ ONLY in objects which have the property name set to ‘France’. Would it …

How to select size of json array in postgres?

I’ve been fighting this for a long time, but I am not able to construct a query, which would select (and preferably also order by) a count of items in an array. I do have table data like this: And what did I try… also But it sais I’ve tried a lot of different formats but coming from the MS

How to check json format in SQL?

I have a table with a column of type Nvarchar where json is stored. But the format of some of its columns is wrong. So I get an error when I parse them all. I want my query to ignore lines that have errors. It gives this error when I run on all lines: JSON text is not properly formatted.

How to get data from Json to multiple column PostgreSQL

I want to extract many objects (not all object) in JSON but don’t want to type for every single thing like this: Here my DEMO show real data and case, how to extract to multiple columns and cast it to exact data type (float, integer) I refer this question, can I use json_to_record for this or other meth…