MySQL Forums
Forum List  »  Newbie

Single Query to Update same column name in different tables with where condition
Posted by: Kathiresan j
Date: September 25, 2014 01:21AM

Hi,

I have two tables table1 and table2 and having a common column "col1"

When i ran the following query

UPDATE table1, table2 SET col1=FALSE WHERE id = 1;

getting the following error

Error Code: 1052
Column 'col1' in field list is ambiguous

id column exist in both the tables and need to update both the tables to false where the id is equivalent to 1.

could you please help me on how to achieve this in single query?

Thanks.

Options: ReplyQuote


Subject
Written By
Posted
Single Query to Update same column name in different tables with where condition
September 25, 2014 01:21AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.