Odd error in complex query (7.2): Sub-SELECT uses un-GROUPed...

Поиск
Список
Период
Сортировка
От Philip Warner
Тема Odd error in complex query (7.2): Sub-SELECT uses un-GROUPed...
Дата
Msg-id 3.0.5.32.20011029141302.026c0940@mail.rhyme.com.au
обсуждение исходный текст
Ответы Re: Odd error in complex query (7.2): Sub-SELECT uses un-GROUPed...  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
This is using an almost up-to-date CVS version.

Sorry for the convoluted example:
   Create table t1(n text, f1 int, f2 int);   create table g1(n text, t1n text);   create table s1(k1 text, f1a int,
f1bint, f2 int, x int, d timestamp);
 
   create view v1 as select k1, d, (select g1.n from g1, t1 where g1.t1n=t1.n and t1.f1 = s1.f1a and t1.f2 =
s1.f2 limit 1) as a, (select g1.n from g1, t1 where g1.t1n=t1.n and t1.f1 = s1.f1b and t1.f2 =
s1.f2 limit 1) as b,x   from       s1   ;
   explain select coalesce(a, b, 'other') as name, k1, sum(x) as tot      from v1 where         d>'28-oct-2001 12:00'
andd<current_timestamp          group by 1,2 order by tot desc limit 40;   ERROR:  Sub-SELECT uses un-GROUPed attribute
s1.f2from outer query
 

Maybe I am asking too much of views?


----------------------------------------------------------------
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 по дате отправления:

Предыдущее
От: "Mike Rogers"
Дата:
Сообщение: Re: Ultimate DB Server
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: Deadlock? idle in transaction