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 |/