NewbiDoobie
Technical User
I am trying to covert the next section of code to be performed using an inner join opposed to using the covert process.
(I think I am going to have to do this as 2 seperate commands, but this statements does not seem to be working
Here is what the original statement looked like:
(I think I am going to have to do this as 2 seperate commands, but this statements does not seem to be working
Code:
delete a
from @NotInXref a
left outer join
@CurrentXref cx on (a.year -1) = cx.year
and a.make = cx.make
and a.model = cx.model
where a.vehicleid is null
Here is what the original statement looked like:
Code:
delete
from @NotInXref
where convert(varchar(20), [Year]) + '-' + Make + '-' + Model
not in (
select convert(varchar(20), [Year]) + '-' + Make + '-' + Model
from CurrentXref cx
)
OR convert(varchar(20), [Year] - 1) + '-' + Make + '-' + Model
not in (
select convert(varchar(20), [Year]) + '-' + Make + '-' + Model
from CurrentXref cx
)