Jump to content

MySQL user-def. variable -- Can I do something like this?


mrherman

Recommended Posts

This attempt throws an error, but how close am I to getting something like this to work?  (using 5.1) 

 

Thanks.

 

SET @myvar = 
        '(
          "1021X", 
          "2020X", 
          "2023X",
          "2024X"
         )'
         
UPDATE mytable
SET myfield = "Y"
   WHERE myvalue IN @myvar ;

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.