Back

Explore Courses Blog Tutorials Interview Questions
+2 votes
2 views
in SQL by (106k 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.4k 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, 2019 in SQL by Tech4ever (20.3k points)
0 votes
1 answer
asked Jul 23, 2019 in SQL by Tech4ever (20.3k points)
Welcome to Intellipaat Community. Get your technical queries answered by top developers!

29.3k questions

30.6k answers

501 comments

104k users

Browse Categories

...