MySQL - Multiple column UPDATE statement using IF statements -


To link table 2 with target table 1 and populate table 1 when Table 1 is not the default value.

Example:

  Update Table 1A, Table 2bb SET aa.column2 = IF (aa.column2 = 0, bb.column2, aa.column2) and aa .column3 = IF (aa.column3 = 0, bb.column3, aa.column3) ... totaling 5 columns are updating WHERE aa.column1 = bb.column1;  

On getting it I get poor population, however, if I remove all, statement from a SET line if everything works properly.

I'm new to MySQL instead, so anyone can help whoever can provide it,

clear join syntax but, more importantly, you are not connected to and with the set statement You use and to connect to booleans and , to set statement

Update Table 1A Join Table 2 BB On AAC column 1 = BBColym 1 SET aa.column2 has a major effect on it = IF (aa.column2 = 0, bb.column2, aa.column2), aa.column3 = IF (aa.column3 = 0, bb) .column3, aa.column3), ... totaling 5 columns are updating;

Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -