I would like to collect some statistical data and then make some reports on it. I'm creating tables for this task and i'm not sure what is better for filling default values: NULL or ''. What is optimal for storage purposes and for further reports creation? Thanks in advance.
jollymcfats
8:14 pm on Jan 27, 2005 (gmt 0)
If you're willing to make the slight extra effort to use & handle NULL, it is a better choice for a not-present value because it provides you with additional information about why the field is blank.
Often NULL is used to mean "A value isn't available" and the empty-string '' means "There is a value, and it is empty." Subtle difference, but often critical for things like reports.
GreenLeaf
11:34 pm on Jan 27, 2005 (gmt 0)
I remember to have problems with NULL in UNION statements like
select something, null, ... union all select null, something2, ...
What are the rules to make these queries right? Thanks a lot.
mcibor
3:12 pm on Jan 28, 2005 (gmt 0)
You can't select null. you can only select columns and null is a keyword (the same as order or date).