Re: [SQL] using top-level aggregate values in subqueries

2001-04-26 Thread Ossie J. H. Moore
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

Re: [SQL] using top-level aggregate values in subqueries

2001-04-23 Thread Tom Lane
"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

[SQL] using top-level aggregate values in subqueries

2001-04-23 Thread Thomas F. O'Connell
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