I have two MySQL tables a and b with fields x and y. Table b has 1 extra field z. Table a is in database db1 and b is in db2. I want to copy x and y from a to b and set a static value for z. How can I do that ?
db1.a.x -> db2.b.x
db1.a.y -> db2.b.y
4 -> db2.b.z
So far I have:
"INSERT INTO db2.b (x,y) SELECT x,y FROM db1.a"
How do I set db2.b.z to 4 ? I do not want to set a permanent default variable for the table.