MySQL solution | Solution to Invalid Testcase Error | 2 Different Methods
In case you get INVALID TESTCASE \'salary\' error. Ignore the error and directly submit the solution. The system will ACCEPT.\n\nThere is some problem in the de
In case you get INVALID TESTCASE \'salary\' error. Ignore the error and directly submit the solution. The system will ACCEPT.\n\nThere is some problem in the default testcase.\n\n*Please Upvote if you like the solution.\n\n# 1st Method\n```\n UPDATE salary SET sex = IF(sex = \'m\', \'f\', \'m\')\n```\n# 2nd Method\n```\nUPDATE salary\nSET\n    sex = CASE sex\n        WHEN \'m\' THEN \'f\'\n        ELSE \'m\'\n    END;\n```
['MySQL']