I have 4 tables. We are going to insert data into one of the tables (table A). Table A will get different data from tables B, C, D as well as some unknown variable parameter data.
How do I set up INSERT with SELECT while also getting parameters?
InsertINTO TableA (col1, col2,col3,col4)
SELECT b.col1, c.col2, d.col3, @myparam
FROM TableB as b
INNERJOIN TableC as c
ON b.id = c.id
INNERJOIN TableD as d
on c.id = d.id