Questions tagged [json-arrayagg]

55 questions
0
votes
0 answers

How To Convert Result Table to JSON in MySQL with Multiple Table Join

I have MySql Query like this: SELECT product_list.id AS listId, product_list.class AS listClass, product.prod_name AS prodName, product.prod_url AS prodUrl, product.prod_overview AS prodOverview, …
0
votes
0 answers

JSON_ARRAYAGG returns itself as key

Given the following query: SELECT JSON_ARRAYAGG( JSON_OBJECT( "empresa_id", agenda.empresa_id, "nombreemp", agenda.nombre_empresa, "personas", (SELECT DISTINCT JSON_ARRAYAGG(JSON_OBJECT("nombrecon",s.nombre_contacto))…
Germán
  • 1,007
  • 1
  • 7
  • 20
0
votes
1 answer

MYSQL - using array in WHERE IN clause

Having a json array column in a table e.g. ["A1", "A2", "B1"]. I want to reference that array in WHERE IN clause. I could not evaluate the json array to ... WHERE tbl2.refID IN ("A1", "A2", "B1"). SET @ref = replace(replace('["A1", "A2", "BI"]','[',…
Dare
  • 15
  • 4
0
votes
1 answer

How to return total amount of colors without interfering with JSON_ARRAYAGG and LIMIT in FROM subquery

The product has two colors (Black and White) I would like to use a LIMIT to not bring all the colors... and the amount of colors would be the total Example: LIMIT 1 would return: colorsName: "[{"color": "Black"}]" amountColors: int(2) LIMIT 2…
0
votes
1 answer

MariaDb vs MySQL JSON_ARRAYAGG JSON_OBJECT Without Escaping

I have a select query, which works just fine in my localhost MySQL database environment. It should return json object. When I run the same query on my hosted public server with MariaDB 10.5.15 installed, the returned json includes several…
gdolenc
  • 301
  • 1
  • 2
  • 17
0
votes
1 answer

T-SQL parse JSON array without property name in SQL Server

Environment SQL Server 2016 Windows 2016 I'm currently getting information from an API. When I call this API, I get the following JSON text…
Chris
  • 265
  • 2
  • 16
0
votes
0 answers

SQL json_object producing duplicate values

This is what i need to achieve: {"id":1, "work":[ { "name":"Pied Piper3" }, { "name":"Pied Piper" } ], "awards":[ { "title":"Digital Compression Pioneer Award" } ]} This is what i am…
0
votes
0 answers

SQL json_arrayarg with json_object producing duplicate values

This SQL query gives me same values repeatedly: select json_object('id',basics.resume_id, 'work',JSON_ARRAYAGG(json_object('name', work.name, 'location', work.location, 'description', work.description, 'position', work.position, 'url',…
0
votes
1 answer

How can we get result as Json array in ORDS?

Is there any possibility to get JSON array instead of JSON object as a result while calling REST API which is built by using Oracle Rest Data Services(ORDS)??
0
votes
1 answer

merge 3 different json array objects into a single json array based on key values in javascript

I am trying to merge 3 different json array objects as a single object based on key values in the base json object in JavaScript. I haven't tried anything like this before. Data looks something like this. var baseObj = [ { "miId": 1, "val": 2,…
kavya
  • 157
  • 2
  • 10
0
votes
1 answer

how to set Text of total amount of prouduct which got from API?

I want to display total amount of product which I got from API. Here is the code which i implemented. Error shows that onErrorResponse: org.json.JSONException: Value Final:92 of type java.lang.String cannot be converted to JSONArray private void…
Shweta
  • 23
  • 5
0
votes
1 answer

What is the best way of getting index from huge JSON Array of objects that matches with array of JSON objects

I want to know the best way of getting indexes from huge (array length is nearly 150 000) JSON Array of JSON objects that matches with array of JSON objects. Currently I'm using for loop to do this job but it is taking 3 to 4 minutes of time. Is…
0
votes
1 answer

MYSQL query to get array list with each row having different children

Lets say we have three tables category_level_one id cat_name 1 Physics 2 Chemistry category_level_two id sub_cat_name cat_l1_id 1 Organic 2 2 Inorganic 2 3 Physical 2 4 Mechanics 1 5 Electricity and…
Mr X
  • 1,637
  • 3
  • 29
  • 55
0
votes
0 answers

How to write a query to compare among objects from json object array in Postgresql database

I have a column as jsonb in PostgreSQL which can have the below json array references: [ { "endTime": { "dayOfWeek": "TUESDAY", "timeOfDay": { "hours": 14, "minutes": 30 } }, "skillCode": "1000124", …
0
votes
1 answer

MariaDB JSON_ARRAYAGG gives wrong result

I have 2 problems in MariaDB 15.1 when using JSON_ARRAYAGG The brackets [] are omitted Incorrect wrong result, values are duplicates or omitted My database is the following: user: +----+------+ | id | name | +----+------+ | 1 | Jhon | | 2 | Bob …