Subject | Re: using ALL or ANY |
---|---|
Author | Rick Roen |
Post date | 2007-01-24T22:46:06Z |
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
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
>O.CUSTNUM =
> Rick Roen wrote:
> >
> > Select C.*
> > from CUSTOMERS C
> > where 1000 > ALL(Select Sum(O.TOTAL) from ORDERS O where
> > C.IDNUM Group by O.SEASON)much
> >
> > but this is returning Customers that do not even have one sales,
> > less all SEASON's sales over 1000.
>
> Why are you asking for all the sums to be less than 1000?
>
> Regards,
>
>
> Ann
>