Monday, July 16, 2007

Math lesson: 1 + 0 = 0?

They say - every day you should learn something new.
Well, I certainly did today.
I would have never thought that if you're concatenating two columns in SQL and one of them is NULL, then... Correct!
Based on server settings the result may very well be NULL!

Now, that is probably a well-known fact, however, logically speaking it doesn't make sense...

2 comments:

Dmitry Platonoff said...

It's not "0", it's "nothing". It makes a difference. In SQL, virtually any expression involving a NULL will default to NULL by definition. But then you know that already.

Anonymous said...

Well said.