how to convert my mysql table result into json Object in database level
for example ,
SELECT json_array(
         group_concat(json_object( name, email))
FROM ....
it will produce the result as
[ 
   { 
     "name": "something",
     "email": "someone@somewhere.net"
    }, 
   { 
     "name": "someone",
     "email": "something@someplace.com"
    }
]
but what i need is i need to given my own query which may contains functions, subqueries etc.
like in postgres select row_to_json(select name,email,getcode(branch) from .....) then i will get the whole result as json object
in mysql is there any possibilities to do like this?
select jsonArray(select name,email,getcode(branch) from .....) 
 
     
    