Re: Odd error in complex query (7.2): Sub-SELECT

Поиск
Список
Период
Сортировка
От Philip Warner
Тема Re: Odd error in complex query (7.2): Sub-SELECT
Дата
Msg-id 3.0.5.32.20011030143543.02b09870@mail.rhyme.com.au
обсуждение исходный текст
Ответ на Re: Odd error in complex query (7.2): Sub-SELECT uses un-GROUPed...  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Odd error in complex query (7.2): Sub-SELECT uses un-GROUPed...  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
At 14:36 29/10/01 -0500, Tom Lane wrote:
>Philip Warner <pjw@rhyme.com.au> writes:
>> Sorry for the convoluted example:
>
>A simplified example is 

And here's a simpler one that seems to avoid views altogether:
   create table lkp(f1 int);   create table t1(f1 int, x int);
   Select        case when Exists(Select * From lkp where lkp.f1 = t1.f1) then            'known'        else
'unknown'        end as status,         sum(x)   from t1   group by 1;
 

It's pretty similar to the sample you gave, but also presents the sort of
operation people may well want to perform.    


----------------------------------------------------------------
Philip Warner                    |     __---_____
Albatross Consulting Pty. Ltd.   |----/       -  \
(A.B.N. 75 008 659 498)          |          /(@)   ______---_
Tel: (+61) 0500 83 82 81         |                 _________  \
Fax: (+61) 0500 83 82 82         |                 ___________ |
Http://www.rhyme.com.au          |                /           \|                                |    --________--
PGP key available upon request,  |  /
and from pgp5.ai.mit.edu:11371   |/


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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: 7.2b1 ...
Следующее
От: Tatsuo Ishii
Дата:
Сообщение: statistics collector