> In each row, do you want balance before that row's credit/debit has
> taken place, or after? <= does the latter, < would do the former.
yes, I understand.
> My statement never uses any previous value of ACCOUNT field, null or
> otherwise.
yes of course, how stupid of me !
thanks a lot
___
c.panel <[EMAIL PROTECTED]> wrote:
> Good ! I've not seen like this !
> but why "where t2.DATE <= mytable.DATE" instead of where "t2.DATE <
> mytable.DATE"
In each row, do you want balance before that row's credit/debit has
taken place, or after? <= does the latter, < would do the former.
> beca
thank you. But I have a question : is rowid growing with dates ? I believed
that rowid is the original order, not the index order (???). I'm going to
look at this.
Samuel Neff wrote:
>
> you can do it with a subquery, like
>
> select o.date, (select sum(credit - debit) from bank i where i.rowi
Good ! I've not seen like this !
but why "where t2.DATE <= mytable.DATE" instead of where "t2.DATE <
mytable.DATE"
because what about if ACCOUNT soon exists with no null value and you want to
update?
Igor Tandetnik wrote:
>
> c.panel <[EMAIL PROTECTED]> wrote:
>> one example:
>> Suppose I have
c.panel <[EMAIL PROTECTED]> wrote:
> one example:
> Suppose I have a table with column DATE, CREDIT, DEBIT
> I want to create a new column that is the balance of account
> (ACCOUNT).
> My first approach is to index the table on dates, then starting with
> 0, then ACCOUNT = preceding ACCOUNT + CREDI
you can do it with a subquery, like
select o.date, (select sum(credit - debit) from bank i where i.rowid <
o.rowid) from bank o order by rowid;
but it would be _much_ more efficient to handle it in your host application
as you loop through the data.
Notice that I used rowid instead of date 'caus
Hello,
I'm learning SQL and have some difficulties to resolve some simple problems
with SQL.
one example:
Suppose I have a table with column DATE, CREDIT, DEBIT
I want to create a new column that is the balance of account (ACCOUNT).
My first approach is to index the table on dates, then starting
7 matches
Mail list logo