Viewing 4 posts - 1 through 4 (of 4 total)
This works but hoping for better solution
March 12, 2018 at 4:06 pm
Declare @Row_number int=1
Declare @Max_Row int
Select @Max_Row=MAX(Row_count) from #final
While @Row_number<=@Max_Row
Begin
Insert into X(Name,Work,ID,Part)
Select Name,Work,ID,Part from #final where Row_count=@Row_number and ID not in (Select ID from X)...
March 12, 2018 at 4:03 pm
I don't want keep real-time data outside. Please look into below example.
create table #temp (Name varchar(10),Work Varchar(10),ID int, Part Varchar(2))
Insert into #temp(Name,Work,ID,Part)
Select 'John','IT',1,'x' union
March 12, 2018 at 3:04 pm
Hi John,
Its not home work. The requirement is very broader(its not just Id and Item) and I minimized it to smaller so that it will be easily understood.
March 12, 2018 at 12:41 pm
Viewing 4 posts - 1 through 4 (of 4 total)