Created
June 7, 2020 20:30
-
-
Save jagomf/f9481d928fe9fe62b2d441bfa9e17b2d to your computer and use it in GitHub Desktop.
MySQL table to JSON
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT JSON_PRETTY(JSON_ARRAYAGG( | |
JSON_OBJECT('code', code, 'name', name, 'iso3', iso3, 'numcode', numcode, 'city', city) | |
)) FROM country; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment