How to add static value when doing INSERT INTO with SELECT in a MySQL query?
SELECT 4
will give you 4
, so try:
INSERT INTO db2.b (x,y,z) SELECT x,y,4 FROM db1.a
INSERT INTO db2.b (x, y, z) SELECT x, y, 4 FROM db1.a;
SELECT 4
will give you 4
, so try:
INSERT INTO db2.b (x,y,z) SELECT x,y,4 FROM db1.a
INSERT INTO db2.b (x, y, z) SELECT x, y, 4 FROM db1.a;