Created
June 4, 2018 20:48
-
-
Save landbryo/cd89b8bfe8d915664f008d46f2e33af3 to your computer and use it in GitHub Desktop.
Useful MySQL select and update
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
/* find all matches for strings starting with 2070 in the fire_date column of the termmeta table */ | |
SELECT * FROM `as9g6f0_termmeta` WHERE `meta_key` LIKE 'fire_date' AND `meta_value` LIKE '2070%'; | |
/* find all matches for strings starting with 2070 in the fire_date column of the termmeta table and replace them with 1970 */ | |
UPDATE as9g6f0_termmeta | |
SET meta_value = REPLACE(meta_value,'2070','1970') | |
WHERE `meta_key` LIKE 'fire_date' AND `meta_value` LIKE '2070%'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment