Upcoming Events
2024-11-04 @ 09:00 - 17:00
Whether you’re aiming to be the next great query tuning wizard or you simply need to tackle tough business problems at work...read more
2024-11-05 @ 09:00 - 17:00
Picture this: a day crammed with fun, fascinating demonstrations for SQL Server and Azure SQL. This isn’t your typical training day; this session follows the mantra of “learning by doing,” with...read more
Empty strings are storage vendors friends. It’s all about perspective.
What did I win?
An empty string.
What about ‘NULL’ as a string? That seems like a nice compromise. That way everybody knows what’s going on.
The best-laid plans, etc.
https://www.bbc.com/future/article/20160325-the-names-that-break-computer-systems
Well that’s just lazy.
I think they’re even worse than NULLs! No arguments here.
You’re my favorite commenter.
ORACLEism is just right there…
This is a family friendly blog.
Oracle’s pricing always reminds me of Mr. Fiddler in Carry on Camping.
“That’ll be a pound.”
https://youtu.be/0wt0vtNvg98
When you charge your clients based on how much space the database consumes?
Well that’s uh. You know. Mean.
I teach this during t-sql fundamentals, when I compare INTERSECT vs INNER JOIN (two-value logic vs three-value logic).
You cannot INNER JOIN a NULL-able column that contains, well, NULLs, whereas INTERSECT couldn’t care less about your NULLs (two value logic). Let me rephrase that, you can INNER JOIN, it’s just a terrible idea, that’s all.
So, by using an empty string instead of NULL you can go old school with JOINs. Like 99,9% of the general population – you know, the ones telling you how cool NoSQL is.
No one joins on strings ?
Consider the case of the non-null column where stupid humans, errr,,, ummm… “people” use NULL and Empty strings to mean the same thing.
Then when they want to find things that don’t have a value, they end up with criteria that looks like one of the following:
WHERE (SomeColumn IS NULL or SomeColumn = ”)
WHERE ISNULL(SomeColumn,”) = ”
In this case, empty strings in a non-null column are much better than having NULLs in the column.
Do I get to say that I proved you wrong (which would be an extreme rarity by anyone and then only because someone has to do something wrong for you to be wrong)? 😀
Sounds like a data quality problem ?
😀
Exactly! And a very common one!
p.s. And I agree with Calin… his post is another place where empty strings are better than NULLs but for the same reason.
Heh… Empty Strings Rock!
Oraclish scent… it is growing…
ORDER BY { column-Name | [ ASC | DESC ] | [ NULLS FIRST | NULLS LAST ] }
I’m not sure we have to abide by the [same documentation](https://docs.microsoft.com/en-us/sql/t-sql/queries/select-order-by-clause-transact-sql?view=sql-server-ver15).
I mean, I agree with you.
I use NULL in my projects (SQL Server and PostgreSQL) and we work well together. NULL has saved my skin many times when some (user or developer) going bullshits.
It’s probably a matter of habit.
🙂
Yep, totally! Glad you’re on Team NULL!