Bug #46854 How to update the table
Submitted: 21 Aug 2009 12:28 Modified: 21 Aug 2009 14:20
Reporter: vinu manikandan Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S1 (Critical)
Version: OS:Linux
Assigned to: CPU Architecture:Any

[21 Aug 2009 12:28] vinu manikandan
Description:
Table(A)   Value   Table(B)   Value     Table(c)    Value   
 Name     Branch   Name     Branch       Name     Branch
 a1        aaa     a1        aaa         b2        aaa
 a2        bbb     a2        bbb         b3        bbb
 a3        vvv     a3        vvv         a1        vvv
 a4        ddd     a4        ddd         c2        ddd
 b2        eee     b2        eee         d2        eee

There are three tables A,B and C, each table contains two columns: Name and Branch. Column: Name is primary Key in all the Tables.

 Table B is Child table to Table A.  

I want to replace the values in column: Name in tables A and B with Value in Table C where Value in Column: Branch is Same as in Table A, Table B and Table C. 

For example: The Value in column: Name is a1 in table A and table b B for Branch aaa, But in table C it is B2. I want to replace a1 with B2 

Please not that Column: Name is primary key, the value B2 is already present in table A and table B for another entry(Last entry)

 

How to repeat:
Table(A)   Value   Table(B)   Value     Table(c)    Value   
 Name     Branch   Name     Branch       Name     Branch
 a1        aaa     a1        aaa         b2        aaa
 a2        bbb     a2        bbb         b3        bbb
 a3        vvv     a3        vvv         a1        vvv
 a4        ddd     a4        ddd         c2        ddd
 b2        eee     b2        eee         d2        eee

There are three tables A,B and C, each table contains two columns: Name and Branch. Column: Name is primary Key in all the Tables.

 Table B is Child table to Table A.  

I want to replace the values in column: Name in tables A and B with Value in Table C where Value in Column: Branch is Same as in Table A, Table B and Table C. 

For example: The Value in column: Name is a1 in table A and table b B for Branch aaa, But in table C it is B2. I want to replace a1 with B2 

Please not that Column: Name is primary key, the value B2 is already present in table A and table B for another entry(Last entry)
[21 Aug 2009 14:20] MySQL Verification Team
We're sorry, but the bug system is not the appropriate forum for asking help on using MySQL products. Your problem is not the result of a bug.

Support on using our products is available both free in our forums at http://forums.mysql.com/ and for a reasonable fee direct from our skilled support engineers at http://www.mysql.com/support/

Thank you for your interest in MySQL.