A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
Hi @Mansoor Mohammed ,
Welcome to Microsoft Q&A!
Please also refer below:
insert into table3
select a.OrderNumber,a.Item,isnull(a.Date,b.Date)
from table1 a
inner join table2 b on a.OrderNumber=b.OrderNumber
OR
insert into table3
select * from table1
where date is not null
union
select b.* from table1 a
inner join table2 b on a.OrderNumber=b.OrderNumber
where a.Date is null
Best regards,
Melissa
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.