Subject | Re: using ALL or ANY |
---|---|
Author | Rick Roen |
Post date | 2007-01-24T23:01:12Z |
Thanks Sven,
The nested "exists" DO work in 1.5.3.
I'm have not yet verified the results but I get a result set.
I can't follow the purpose of the second "not exists..."?
Rick
--- In firebird-support@yahoogroups.com, Svein Erling Tysvaer
<svein.erling.tysvaer@...> wrote:
The nested "exists" DO work in 1.5.3.
I'm have not yet verified the results but I get a result set.
I can't follow the purpose of the second "not exists..."?
Rick
--- In firebird-support@yahoogroups.com, Svein Erling Tysvaer
<svein.erling.tysvaer@...> wrote:
>1000)
> Hmm, this sounds unusual and requires some thinking.
>
> SELECT C.*
> from CUSTOMERS C
> where not exists(Select O.Season, SUM(O.Total) From ORDERS O
> where O.CUSTNUM = C.IDNUM Group by O.Season HAVING SUM(O.Total) <
> and not exists(select * from ORDERS O2know
> where not exists(select * from ORDERS O3 where O3.CustNUM = C.IDNUM
> and O3.Season = O2.Season))
>
> Now, I've never tried using GROUP BY within a subselect and don't
> whether that works in Firebird 1.5 (I doubt it). The second notexists
> (the one that is nested) should work and ensures that customerswith no
> orders in a season are eliminated from the result.
>
> Tell us whether this works, if not I think you have to
>