-
Inset Question
Hi,
I want to insert three values into a table ( say TableA ). One of the values is the result of a select on TableB and the other two are hard coded values. Both tables are joined ok.
The SQL definition for insert says either
insert table(col1, col2, ...) values(...)
or
insert table(col1, col2, ...) select .....
my requirement seems to be a combination of the two. In Psuedo code
insert into TableA(col1, col2, col3) select colA from TableB where ..., 99, 99
Can the insert be done in one command?
Many thanks
Lenin
-
This should work:
insert into TableA(col1, col2, col3) select colA ,99,99 from TableB where ....
-
Thought I had tried this, obviously not, it worked fine. Many thanks.