Table A has Id_1, Id_2 Table B has Id, ..., ..., ...,
How can I grab every Id > 118 from Table B and insert each Id as a row (999, Id) into Table A?
So the results would look like,
Insert into Table A (Id_1, Id_2)
VALUES (999, 118), (999, 119), (999, 120), .....
Thanks.
You can use the results of a select for the insert statement, something like the below.
INSERT INTO TableA (Id_1, Id_2)
SELECT 999, Id
FROM TableB
WHERE Id > 118
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments