summing tables

Поиск
Список
Период
Сортировка
От Erik Thiele
Тема summing tables
Дата
Msg-id 20030715140921.7c5a6a6c.erik@thiele-hydraulik.de
обсуждение исходный текст
Ответы Re: summing tables  (Dani Oderbolz <oderbolz@ecologic.de>)
Список pgsql-sql
hi,

i have a table consisting of 4 integers.

seq is for making the table ordered. (ORDER BY SEQ ASC)
a,b,c maybe null

seq | a  | b  | c 
-----+----+----+---  0 |  1 |  2 | 3  1 |  1 |  2 |    2 |  5 |  7 |    3 | -2 | -4 |  


i am needing a sql statement to do

c=a+b+"the c of the row with seq one less than myself"

this statement has to run over the whole table, in seq order.


how can this be acomplished???


cu&thanks
erik


-- 
Erik Thiele


В списке pgsql-sql по дате отправления:

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: ad hoc referential integrity
Следующее
От: "Viorel Dragomir"
Дата:
Сообщение: Re: summing tables