First attach the 3 databases:
ATTACH "allab_X.db" AS db1;
ATTACH "allab_Y.db" AS db2;
ATTACH "allab_Z.db" AS db3;
Create the new table:
CREATE TABLE db3.PAYMENT(Pmt_ID TEXT PRIMARY KEY, P_CUSTOMER_NAME TEXT, P_CASH_AMOUNT REAL);
Finally insert the rows:
INSERT INTO db3.PAYMENT(Pmt_ID, P_CUSTOMER_NAME, P_CASH_AMOUNT)
SELECT 'X' || Pmt_ID, P_CUSTOMER_NAME, P_CASH_AMOUNT FROM db1.PAYMENT
UNION ALL
SELECT 'Y' || Pmt_ID, P_CUSTOMER_NAME, P_CASH_AMOUNT FROM db2.PAYMENT
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…