update via join problem

Поиск
Список
Период
Сортировка
От Johnson, Shaunn
Тема update via join problem
Дата
Msg-id 73309C2FDD95D11192E60008C7B1D5BB0452E3AD@snt452.corp.bcbsm.com
обсуждение исходный текст
Ответы Re: update via join problem
Список pgsql-general

Running Postgres 7.1.3 on RedHat Linux 7.2.

I have a query where I only want to update one table
and set a column to null.

To figure out what records I need to update, I do
this:

[snip code]

--explain
select count (s.result)
--update
--only sys_results
--set s.result = null
from sys_results s, load_pp_results_ldl_fix_020502 l
where
l.contract::char = s.contract and
l.mbr_num::char = s.mbr_num and
l.type::char = s.type and
l.date = s.date and
s.type='LD' and
s.result='0' and
l.result='NR TRIG HI'
;
[/snip code]

When I change this code to 'update',
I find that the entire table has been updated /
changed to reflect null in the s.result column.

Can someone tell me what I did wrong?

Thanks!

-X

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

Предыдущее
От: Scott Marlowe
Дата:
Сообщение: Re: count problem
Следующее
От: Patrick Welche
Дата:
Сообщение: Re: aggregate on zero rows slow?