Skip to content

Instantly share code, notes, and snippets.

@flores
Created April 26, 2011 21:57
Show Gist options
  • Save flores/943279 to your computer and use it in GitHub Desktop.
Save flores/943279 to your computer and use it in GitHub Desktop.
SQL concat into JSON
SELECT CONCAT(
CONCAT("{'key':",column1,","),
CONCAT("'field2name':",column2,","),
CONCAT("'field3name'",column3,"}")
) FROM table
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment