Create JSON Object and Array

suggest change

JSON_OBJECT creates JSON Objects:

SELECT JSON_OBJECT('key1',col1 , 'key2',col2 , 'key3','col3') as myobj;

JSON_ARRAY creates a JSON array:

SELECT JSON_ARRAY(col1,col2,'col3') as myarray;

Note: myobj's key key3 and myarray's element 2 (JSON arrays are zero-based) are the fixed string "col3", not a column.

Also mixed JSON data:

SELECT JSON_OBJECT("opening","Sicilian", "variations",JSON_ARRAY("pelikan","dragon","najdorf") ) as mymixed ;

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents