I suspect using NULL might make searches a bit more efficient in some cases, but that's just speculation on my part. The main reason I'd consider using NULL is for the ability to filter on it with IS NULL and IS NOT NULL. It just seems a bit cleaner to me to do...
Code:
SELECT * FROM foo WHERE bar IS NOT NULL ORDER BY something
...versus...
Code:
SELECT * FROM foo WHERE bar != '' ORDER BY something
(Even though the 2nd version takes fewer keystrokes, for some reason the first seems clearer and more semantically correct to me.)
Also, depending on what DBMS you are using, some have nifty shortcuts for sorting all nulls to the top or bottom regardless of ASC or DESC sort order, which can sometimes be useful.
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Bookmarks