Skip to content
Advertisement

SQL INSERT INTO from multiple tables

this is my table 1:

this is my table 2:

and now I want a table 3 which shows me all information:

I tried first to insert into table 3 only the values from table 1 and then I inserted into table 3 the values from table 2 with an inner join where Id = Id is.

But all I get is a duplication of my values. instead of having 3 entries, I have like 9 entries, which some have number null, some have only the number and the rest null, and some are correct.

I hope someone can help me

EDIT

If I am having now a third Table like this one:

How could I merge all 3 tables into one Table?

Advertisement

Answer

You only need one INSERT:

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement