Home > OS >  insert into a table from another table with different columns
insert into a table from another table with different columns

Time:10-23

I have two tables A and B, so that B ⊂ A (it means every column of B is in A, but A has more columns that there is not in B)

Table A is empty and I want to insert the Values of B into A. how can I do that?

for Example: A:
enter image description here

B:
enter image description here

CodePudding user response:

This should work I think

INSERT INTO A (load, Roll, dest)
SELECT load, Roll, dest
FROM B
  • Related