Re: VFP 9: SQL: sum() of Zero Items
- From: Gene Wirchenko <genew@xxxxxxxx>
- Date: Fri, 17 Nov 2006 14:08:21 -0800
tim_witort@xxxxxxxxxxx (Tim Witort) wrote:
Gene Wirchenko seemed to utter in
news:1f5pl25kus8mbo11tnjnn5i26f3ds7r9p9@xxxxxxx:
"AA" <A@A> wrote:
Null doesn't exist in mathematics, does it? It exists in the SQL
language and in data structures.
In the example with a join query that I posted, the Null helps to
distinguish between an account where + and - balances out to 0 and an
account the doesn't exist according to the terms of the join.
It is not needed. Query directly for the account. If you get a
row back, the account exists.
And the solution for you is equally simple. Check the value
of _TALLY after performing your SQL SELECT. I always check
_TALLY after any operation like this. It's good programming.
It would not work here. I am expecting one row with a value.
When .null. is returned in the row, I still get one row. Since _tally
would have the same value each time, it is not appropriate.
We'd all like certain features to natively support our
particular use, but they don't always do that. That's why
programming is more than throwing a few fomulas together
and turning the crank like in Excel.
The code worked just fine in VFP 6. It does not in 9. You are
right about the not always.
You would do better to realize how your tool works and use
it accordingly. You made a programming mistake. Admit it
and move on. Complaining that the SQL language doesn't
0 is mathematically the sum of zero elements. If SQL gets this
wrong, well, SQL got it wrong.
treat your case like you expect will do nothing. Trust me,
the hundreds of implementations of SQL and VFP's in particular
are not going to abandon the use of .NULL. in such a case.
The use of .NULL. in this and other cases are key to made
RDBMSs work correctly.
NULL is not needed at all for RDBMSs.
Sincerely,
Gene Wirchenko
Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.
.
- Follow-Ups:
- Re: VFP 9: SQL: sum() of Zero Items
- From: Tim Witort
- Re: VFP 9: SQL: sum() of Zero Items
- References:
- Re: VFP 9: SQL: sum() of Zero Items
- From: Gene Wirchenko
- Re: VFP 9: SQL: sum() of Zero Items
- From: Paul Pedersen
- Re: VFP 9: SQL: sum() of Zero Items
- From: Gene Wirchenko
- Re: VFP 9: SQL: sum() of Zero Items
- From: Paul Pedersen
- Re: VFP 9: SQL: sum() of Zero Items
- From: Gene Wirchenko
- Re: VFP 9: SQL: sum() of Zero Items
- From: Paul Pedersen
- Re: VFP 9: SQL: sum() of Zero Items
- From: Gene Wirchenko
- Re: VFP 9: SQL: sum() of Zero Items
- From: Gene Wirchenko
- Re: VFP 9: SQL: sum() of Zero Items
- From: Tim Witort
- Re: VFP 9: SQL: sum() of Zero Items
- Prev by Date: Re: VFP 9: SQL: sum() of Zero Items
- Next by Date: Re: I got a strange low level file io problem
- Previous by thread: Re: VFP 9: SQL: sum() of Zero Items
- Next by thread: Re: VFP 9: SQL: sum() of Zero Items
- Index(es):
Relevant Pages
|