Last active
January 16, 2018 04:14
-
-
Save rahuldadhich/26b25b1fce584d1f738beb497127ad58 to your computer and use it in GitHub Desktop.
MYSQL JSON methods
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
// compair date from JSON | |
WHERE updated > JSON_UNQUOTE(json_column->'$.JSON_KEY_NAME') | |
##### | |
// SAVE JSON value in UPDATE query | |
// when don't know either JSON key have set value or not? | |
UPDATE table SET table_col = JSON_SET(COALESCE(table_col, '{}'), '$.JSON_KEY_NAME', 'json_values') | |
##### | |
// |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment