+2 votes
1 view
in SQL by (92.9k points)

I have seen SQL that uses both != and <> for not equal. What is the preferred syntax and why?

I like !=, because <> reminds me of Visual Basic.

1 Answer

+3 votes
by (40.3k points)
edited by

It’s mostly recommended to use <> as it is ANSI compliant. Technically their functions are the same. If you’re using SQL Server AKA T-SQL (Transactional Structured Query Language).

Are you interested in learning SQL from scratch! Have a look at this interesting video on SQL provided by Intellipaat:

 But, if you're using it in stored procedures then you can use either != or <> .

Related questions

0 votes
1 answer
0 votes
1 answer
asked Jul 13 in SQL by Tech4ever (22.4k points)
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...