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