If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > update column using condition

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-22-08, 09:11
ankur02018 ankur02018 is offline
Registered User
 
Join Date: Jun 2007
Posts: 189
Smile update column using condition

I want to update a column using as follow

Table structure

Table name=A
a1 varchar( contains Name)
b1 varchar(require code from d1 where a1 matches with c1)
c1 varchar(contains Name)
d1 varchar(code corressponding to c1)

Now i want to update b1 as such where value a1 =c1 then corressponding value should be updated

How can we do ?
Reply With Quote
  #2 (permalink)  
Old 05-22-08, 10:18
mike_bike_kite mike_bike_kite is offline
vaguely human
 
Join Date: Jun 2007
Location: London
Posts: 2,519
This is a link to a description of the MySQL update statement - have a look at how to use the where clause. It's amazing how useful it can be.

Mike
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On