I have 3 tables: table1 (bar, change, kit, lot, part), table2 (order, start date), table3 (end date)
I want to join them and then insert those values into table4 (bar, change, duplicate, kit, lot, part, order, start date, end date)
I have no issue joining the 3 tables, it's the inserting into the new table I can't seem to figure out
The general SQL form for this sort of thing looks like this:
INSERT INTO "someTable" ("someColumn1", "anotherColumn")
SELECT someExprFor1, anotherExprFor2
FROM ....
In other words, just replace the VALUES (...) clause of a normal insert with the complete SELECT ... that has your joins. Just be sure that your select's output columns match up 1-for-1 with the target table columns that you've called out.
I ended up not needing the date columns so I did INSERT INTO table4 (bar, change, duplicate, kit, lot, part, order) SELECT bar, change, duplicate, kit, lot, part, (SELECT order FROM table2) FROM table1
and it worked