[Helma-user] allowing NULL VALUES in foreign keys
nighthawk
nighthawk at gmail.com
Tue Aug 22 01:05:29 CEST 2006
On 8/22/06, Julian Tree <julian.tree at gmail.com> wrote:
> [...] Maybe someone can give me an example, but i don't see any
> difference from an application logic point of view and most
> importantly from a user point of view to have to have null or blank.
> It just seem like one less things to worry about.
Well. As I wrote before, one example is the counting. If you only need
to know how much actual data is in one column you can also add a "
where field <> '' " statment to your query. It becomes interesting
when you have a table with a few columns that can contain null values.
You can then do
select count(field1), count(field2), count(field3) from table;
and it will count all non-null fields in each column. So if you have
10 rows in your table, the result set will not look like 10 | 10 | 10
but rather 9 | 5 | 8 or something like that. I don't do this on a
daily basis either, but I'm pretty sure there is more examples.
+n
More information about the Helma-user
mailing list