delete from table where isDeleted = 1
select id from products as p
INNER JOIN productPropertys as type ON type.product_Id = p.id and type.value = 'ель'
INNER JOIN productPropertys as length ON length .product_Id = p.id and length .value = '200'
INNER JOIN productPropertys as someOtherProperty ON someOtherProperty .product_Id = p.id and someOtherProperty .value = '10'
insert into tab2 (id,numold)
select id, num from tab1
where id = @inputId
insert into tab1(id,num)
values @inputId,@inputNum
Так нельзя?В противном случае вам нужно определить условие where в первом запросе. Максимальный id или что-то подобное