Using JOIN in MySQL Update statement | Coldfusion

Along with a photographer and cinematographer I also use the other part of my brain for programming. I design web applications using Adobe’s Coldfusion and SQL apps such as MySQL.

I recently had to figure out how to update a field in one database table, based on information in another database table. To do this I was going to need to use a JOIN statement in order to JOIN the two database tables together based on a common field. For those who are looking to do this here is the process:

——————————————————
Update
Table_A as A JOIN Table_B as B on A.field = B.field
Set A.fieldname = ‘value’
where b.field = xxx
——————————————————-

Advertisements

One Response to “Using JOIN in MySQL Update statement | Coldfusion”

  1. Txz…. Helped me

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: