Skip to content
Advertisement

Tag: json

How do I create a structure for a dynamic SQL query?

In my Golang application I make SQL request to the database. Usually, in the SQL query, I specify the columns that I want to get from the table and create a structure based on it. You can see an example of the working code below. QUESTION: What should I do if I don’t know the number and name of columns

Querying JSONB array value for sub values?

I have a JSONB Object: It is stored in a jsonb column of a table So i was trying to get a count by name of devices which have interfaces that are not ‘up’. Group By is used for developing counts by naame, but i am having issues querying the json list for values. MY first Attempt was: Some surrounding

How can I generate JSON results in older SQL Server versions?

I have a table which contains data similar to this. I want to get ItemNames in JSON format as I have mentioned in the expected output below. Expected output: Note: I know in latest SQL Server, there are functions FOR JSON to convert to JSON format but it won’t work in older SQL versions. Therefore, I am expecting the answer

How to parse a json object – mysql

I have a json object like this: {“1”: {“penalty_percent”: 3, “free_day”: 5, “free_hours”: 24}, “2”: {“penalty_percent”: 2, “free_day”: 5, “free_hours”: 12}, “3”: {“penalty_percent”: 2, “free_day”: 2, …

Advertisement