I'm trying to make this example but it's giving the error: # 1582 - Incorrect parameter count in the call to native function 'JSON_OBJECT'
SELECT JSON_OBJECT('City', Name, 'Dist', District, 'Pop', Population) FROM City;
I'm trying to make this example but it's giving the error: # 1582 - Incorrect parameter count in the call to native function 'JSON_OBJECT'
SELECT JSON_OBJECT('City', Name, 'Dist', District, 'Pop', Population) FROM City;
According to the documentation:
"Two aggregate functions generating JSON values are available (MySQL 5.7.22 and later)"
You can check the version of your mysql with this query:
show variables like '%version%';
According to what you said:
@MarceloRafael version Mysql 5.7.17 I did not know. I'll try to update then.
Tip: checks the Mysql version of your hosting.