update from multiple rows
| От | adam etienne |
|---|---|
| Тема | update from multiple rows |
| Дата | |
| Msg-id | BAY13-F384058140ADAAD16F8BE889830@phx.gbl обсуждение |
| Ответы |
Re: update from multiple rows
Re: update from multiple rows |
| Список | pgsql-sql |
hi I have some trouble updating a table like this one : date | data_raw | data_sys 12-01 | 5
| 4.5 13-01 | 6 | 6 14-01 | 7 | 8
I would like to update the 'data_sys' row by computing values of multiple
'data_raw' values. I mean for example :data_sys(13-01) = (data_raw['12-01'] + data_raw['13-01'] +
data_raw['14-01'] )/3;
I thought of a function that fetch the 3 data_raw rows for each rows....
but it was obviously too much slow...
Is there a more efficient way to achieve this ?
Thanks in advance.. This could help me very much..
Etienne Adam
_________________________________________________________________
無料メールならやっぱり 「MSN Hotmail」 http://www.hotmail.com/
В списке pgsql-sql по дате отправления: