| Article: |
SQL Subqueries | |
| Subject: | accumulate a field | |
| Date: | 2006-03-02 01:53:41 | |
| From: | st.chen | |
|
thanks in advance,
|
||
Showing messages 1 through 3 of 3.
| Article: |
SQL Subqueries | |
| Subject: | accumulate a field | |
| Date: | 2006-03-02 01:53:41 | |
| From: | st.chen | |
|
thanks in advance,
|
||
Showing messages 1 through 3 of 3.
qty,
(
(SELECT qty
FROM table b
WHERE b.date = (a.date - 1))
+ qty
) tqty
FROM table a
Syntactically its fine ... I made a small assumption on date being the incremental field, so just alter to suit
enjoy