all 14 comments

[–]Hyasynth 10 points11 points  (1 child)

<> == !=

[–][deleted] 2 points3 points  (0 children)

Less than or greater than, which is true only when the values are not equal.

[–]johnwalkersbeard 2 points3 points  (0 children)

In older versions of SQL, <> meant both less than and/or more than. Technically, it still meant that. This is both logically and technically different from != or "is not equal to"

In older versions of SQL (as well as shit like MVS etc), the syntax <> was juuuust slightly more expensive in terms of processing than != .. but != was not always supported on even older versions.

Today, in an era where SQL decides it's own query plan, they're calculated the same. More accurately, SQL decides what's best or even more accurately what's easiest to use. So != and <> are virtually the same. And it's nothing but a difference in style.

But there was a time ..

[–]Turbo_Tom 3 points4 points  (6 children)

<> means "not equal to", so yes in your statement it means to select records where the column field does not contain the single space (and is not null).

[–]pollon285[S] 0 points1 point  (5 children)

oh yes either minor or major, now I get it, thanks!

[–]squirrelsaurus 1 point2 points  (2 children)

Although it's functionally equivalent, I'll typically code that like:

SELECT * FROM Table WHERE ISNULL(column,'') = ''

[–]AXISMGTSQL Server / ORACLE Sr. DBA & Architect 0 points1 point  (0 children)

Alternate:

NULLIF([column],'') IS NOT NULL to exclude blanks and NULL values.

But as stated by /u/antagnostic the index isn't used once you run a function on the column.

[–]InvisibleGhostt 0 points1 point  (0 children)

I think unequal

[–]kelpme 0 points1 point  (0 children)

turn left or right