Welcome to WebmasterWorld Guest from 54.205.88.118

Forum Moderators: open

MySql Query Help

   
12:31 pm on Mar 19, 2011 (gmt 0)

10+ Year Member



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!
12:06 pm on Mar 20, 2011 (gmt 0)

WebmasterWorld Senior Member topr8 is a WebmasterWorld Top Contributor of All Time 10+ Year Member



update questions set objective = 'text here that you want' where SetID="1" ;
1:00 am on Mar 21, 2011 (gmt 0)

10+ Year Member



Many thanks. That worked perfectly!
 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month