Created
May 29, 2014 09:11
-
-
Save hectorperez/dd6bb9f359a12face93f to your computer and use it in GitHub Desktop.
Variables in MySQL - set @variable, GROUP_CONCAT & FIND_IN_SET
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
| set @checked=(select GROUP_CONCAT(id) from table_name where atribute_name=1); | |
| UPDATE table_name | |
| set atribute_name=0 | |
| where FIND_IN_SET(id,@checked)>0; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment