Subject Re: using ALL or ANY
Author Rick Roen
My mistake in typing but I do want all Sums greater than 1000

1000 < All( sums by SEASON)

To show an example

Customer 1
season 1 2000
season 2 1500
season 3 3000

Customer 2
season 1 1500
season 2 2000
season 3 500

Customer 1 would qualify because all SEASONS > 1000
Customer 2 would NOT qualify because Season 3 < 1000

The problem is in aggregating the sales that make up the SEASON sales
totals and how to compare them all at once and either qualify or
disqualify the customer.

Rick


>
> Rick Roen wrote:
> >
> > Select C.*
> > from CUSTOMERS C
> > where 1000 > ALL(Select Sum(O.TOTAL) from ORDERS O where
O.CUSTNUM =
> > C.IDNUM Group by O.SEASON)
> >
> > but this is returning Customers that do not even have one sales,
much
> > less all SEASON's sales over 1000.
>
> Why are you asking for all the sums to be less than 1000?
>
> Regards,
>
>
> Ann
>