When writing a query, does it matter if I use <> or != when I mean "not equal to"?
As per the example below, nulls don't seem to be affected whether I use <> or !=. Is this an aesthetic thing?
declare @fruit table
(
FruitID int,
FruitName varchar(50)
)
insert into @fruit (FruitID, FruitName) Values (1, 'Apple')
insert into @fruit (FruitID, FruitName) Values (2, 'Orange')
insert into @fruit (FruitID, FruitName) Values (3, 'Pineapple')
insert into @fruit (FruitID, FruitName) Values (null, 'Not a Fruit')
select *
from @fruit
where fruitid<>2
select *
from @fruit
where fruitid!=2