Philip Warner wrote:
>
> At 14:36 29/10/01 -0500, Tom Lane wrote:
> >Philip Warner <pjw(at)rhyme(dot)com(dot)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;
>
A bit off-tppic question, but is our optimiser smart enough to
recognize the query inside exists as LIMIT 1 query ?
------------
Hannu