Subject: Re: [SQL] using top-level aggregate values in subqueries
Date: Mon, 23 Apr 2001 23:24:48 -0500
From: Ossie J. H. Moore <[EMAIL PROTECTED]>
To: "Thomas F. O'Connell" <[EMAIL PROTECTED]>
I'm a little unclear on what you are trying to do here so I'll
"Thomas F. O'Connell" <[EMAIL PROTECTED]> writes:
> select f.id
> from foo f, ola o
> where f.id = (
> select max( b.id )
> from bar b
> where b.bling = "i kiss you!"
> )
> and o.id != (
> select max( b.id )
> from bar b
> where b.bling = "i kiss you!"
> )
> is
from the docs, i know that if you have two tables, foo and bar, you can
write a query such as
select f.bling
from foo f
where f.id = (
select max( b.id )
from bar b
where b.bling = "i kiss you!"
);
what i'm wondering is if you need that subquery in two places in a query