M
M
musclecode2019-07-11 15:47:01
MySQL
musclecode, 2019-07-11 15:47:01

Mysql json_object() is it possible to influence the sort order in this function?

When receiving such a json object, the values ​​are not in order, I want the values ​​​​to be added as they are specified in the database table
id | bob | alex1
| 10 | 12
returns {"alex": 12, "bob": 10}

Answer the question

In order to leave comments, you need to log in

5 answer(s)
I
ivankomolin, 2019-07-12
@ivankomolin

The JSON_OBJECT() function does not affect the sorting of properties in an object in any way.
The object is created exactly in the order you specified.
Example:
Return
{"bob": 10, "alex": 12}

A
Andrey Andreev, 2017-10-06
@EgorWeb

You need to freelance exchange.
For example https://www.weblancer.net/

M
Maxim Timofeev, 2017-10-06
@webinar

A codepen search usually gives a ready-made version, in my opinion this is 1 in 1 like yours:
https://codepen.io/cwrigh13/pen/KvdGp?q=image%20ma...
Other results:
https:// codepen.io/search/pens?q=image%20map&limit...
or alternatively on svg:
https://codepen.io/search/pens?q=svg+map&limit=all...

D
Dima Pautov, 2017-10-06
@bootd

https://www.amcharts.com/svg-maps/?map=russia - Download and do whatever your heart desires!

D
Dealaxer, 2017-10-08
@Dealaxer

You need js library Raphaël!
dmitrybaranovskiy.github.io/raphael/australia.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question