|
Posted by francois.bourdages on 06/01/06 17:57
HandersonVA wrote:
> should I set to "0" as a default value on a quantity and a price field
> or set to "null"?
> if a user enter nothing on the quantity or price field on a web
> browser, should I treat it as null or "0"? I am so confused about this
> concept. please advise me. thank you.
I would do the following :
1) Set quantity and price to "not null"
2) Put 0 when there is no value, instead of NULL.
This way,
a) if you use aggrate function like AVG, thoses functions will use
everyrow
b) non unique index on thoses fields will contained every rows
c) if you query thoses field (where quantité=0) rows will come out. IF
quantity is null and you query thoses rows, youll need (where
quantity=0 or quantity is null)....
etc.
Navigation:
[Reply to this message]
|