Jump to content

[SOLVED] One query, multiple updates


jaymc

Recommended Posts

Is it possible to update numerous tables in the same query, e.g

 

UPDATE `tab1`, `tab2` SET tab1.minutes = '60', tab2.hours = '4'

 

Probably not the syntax, but can it be done rather than using 2 seperate update queries. If so, is it more optimal?

Link to comment
Share on other sites

Nice

 

Would this improve performance, even if its slight?

 

Assuming Im not closing and opening the mysql connection after every query

 

Or is it simple a neater way of updating multiple tables in the same script

Link to comment
Share on other sites

Nice

 

Would this improve performance, even if its slight?

 

Assuming Im not closing and opening the mysql connection after every query

 

Or is it simple a neater way of updating multiple tables in the same script

 

Again with the performance, eh?

 

It's not meant to update multiple tables in the same script... it's meant for updates that require joining multiple tables to produce the result.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.