문제

Is there a difference in performance between != and <>?

Bonus: why do people get upset when I use != instead of <>? I am of course speculating that all programmers get upset about this, however I have worked for two companies now that "require" the use of <>

도움이 되었습니까?

해결책

Short answer: no, there's no difference in performance.

As for the bonus question, I imagine people get upset because != is not defined in the SQL 92 standard and is therefore less likely to be portable.

Edit

The SQL 92 standard can be found here and defines the not equals operator as follows:

<not equals operator> ::= <>

다른 팁

They do not have performance differences, it's certainly for matters of standards/consistence. Take a look at this question: Should I use != or <> for not equal in TSQL?

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top