Skip to content

Instantly share code, notes, and snippets.

@gabidavila
Last active February 21, 2017 00:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gabidavila/6e806b52a06a7d4fb4431a49af7e6e5d to your computer and use it in GitHub Desktop.
Save gabidavila/6e806b52a06a7d4fb4431a49af7e6e5d to your computer and use it in GitHub Desktop.
DELIMITER $$
CREATE FUNCTION to_json_array(input_string TEXT, delimiter_char CHAR(1))
RETURNS JSON
BEGIN
RETURN CONCAT("[", TRIM(BOTH delimiter_char FROM input_string), "]");
END$$
DELIMITER ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment