| MySql Query Help
|
jsprague

msg:4284117 | 12:31 pm on Mar 19, 2011 (gmt 0) | Hello, I am hoping somebody can tell me how to run a query I am trying to do. First, an example of the table. ----------------------------- QID SetID Objective ----------------------------- 1......1......Spanning Tree protocols 2......5......blah blah blah 3......1......Spanning Tree protocols 4......3......Spanning Tree protocols I have been using the following command successfully to replace Objective titles: update questions set objective = replace(objective,'Conduct the operation of Spanning Tree protocols in a hierarchical network','Conduct the operation of Spanning Tree protocols') Now, I need be able to replace instances of an objective with a particular SetID only. So in the example table above, I want to change Spanning Tree Protocols with a SetID of 1 only and not affect setid 3. I tried the following, but it gave and error. update questions where SetID="1" set objective = replace(objective,'Conduct the operation of Spanning Tree protocols in a hierarchical network','Conduct the operation of Spanning Tree protocols') Many thanks!
|
topr8

msg:4284526 | 12:06 pm on Mar 20, 2011 (gmt 0) | update questions set objective = 'text here that you want' where SetID="1" ;
|
jsprague

msg:4284853 | 1:00 am on Mar 21, 2011 (gmt 0) | Many thanks. That worked perfectly!
|
|
|