I would like my MySql query to return a JSON object that looks as follows:
{\"name\": \"Piotr\", \"likesMysql\": true}
This seems to be wor
Aniket Bhansali's approach could be simplified as:
select json_object( 'bool_true', (4 mod 2 = 0) is true, 'bool_false', 0 is true) b;
which returns
{"bool_true": true, "bool_false": false}
Tested on mysql 8.