Created
August 14, 2023 14:49
-
-
Save moaalaa/e5a68804c46563ef974d732de5ff9024 to your computer and use it in GitHub Desktop.
prefix columns in mysql
This file contains 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
# One Columns | |
UPDATE users SET email = CONCAT('lab_', email) | |
# Two Columns | |
UPDATE users SET email = CONCAT('lab_', email), phone = CONCAT('lab_', phone) | |
# Two Columns with condition | |
UPDATE users SET email = CONCAT('lab_', email), phone = CONCAT('lab_', phone) where type != 'admin' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment