Last active
March 4, 2024 07:09
-
-
Save mbparvezme/d861293c98808cabc47ee9a817936ab5 to your computer and use it in GitHub Desktop.
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
// Copy-column.sql | |
UPDATE `table1` SET | |
`table1`.`col` = (SELECT `table2`.`col` FORM `table2` where `table1`.`ID` = `table2`.`fid`) | |
// REPLACE | |
UPDATE table SET col = REPLACE(col,',','') | |
// TRIM | |
UPDATE table SET col = TRIM(col); | |
// SUM with GROUP BY | |
SELECT col_1, SUM (col_2) FROM orders GROUP BY col_3; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment