Re: Re: [SQL] MAX() of 0 records.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Re: [SQL] MAX() of 0 records.
Дата
Msg-id 13643.963192071@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Re: [SQL] MAX() of 0 records.  (Philip Warner <pjw@rhyme.com.au>)
Ответы Re: Re: [SQL] MAX() of 0 records.  (Philip Warner <pjw@rhyme.com.au>)
Список pgsql-hackers
Philip Warner <pjw@rhyme.com.au> writes:
>> What do people think of my implicit-GROUP-BY-ctid idea?
>> That would basically say that the aggregate is computed over all the
>> tuples that join to a single target tuple.

> Sounds perfect to me...

Note that it would not meet your expectation that
   update t1 set f2=count(*) from t2 where t1.f1=2 and t2.f1=t1.f1 ;

means the same as
   update t1 set f2=(Select Count(*) from t2 where t2.f1=t1.f1) where
t1.f1 = 2

... at least not without some kind of outer-join support too.  With
an inner join, t1 tuples not matching any t2 tuple wouldn't be modified
at all.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Re: C language function dump problem
Следующее
От: Philip Warner
Дата:
Сообщение: Re: Re: [SQL] MAX() of 0 records.