I work on sql server 2017 I need to get different of feature value based on partid and feature name
I search for alternative way to compare different values based on partid and feature name without using <> not equal operator
because i face slow when using <> not equal so what i do
so i try below
create table #parts
(
PartId int,
FeatureName varchar(50),
FeatureValue varchar(50)
)
insert into #parts(PartId,FeatureName,FeatureValue)
values
(1211,'Height',50),
(3211,'Air',90),
(6121,'Size',300),
(7921,'Area',790),
(9871,'Factors',210)
create table #partsDetails
(
PartId int,
FeatureName varchar(50),
FeatureValue varchar(50)
)
insert into #partsDetails(PartId,FeatureName,FeatureValue)
values
(1211,'Height',120),
(3211,'Air',90),
(6121,'Size',200),
(7921,'Area',790),
(9871,'Factors',410)
select p.* from #parts p
inner join #partsDetails d on p.partid=d.partid and p.featurename=d.featurename and p.featurevalue<>d.featurevalue
my question what alternative of used (<> operator) when compare different values ?