View Single Post
  #3 (permalink)  
Old August 27th, 2008, 03:59 PM
SerranoG SerranoG is offline
Friend of Wrox
Points: 4,007, Level: 26
Points: 4,007, Level: 26 Points: 4,007, Level: 26 Points: 4,007, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

I think I get it. Let's say a plain select query lists them sorted by priority and you have 1000 records. It just so happens that if you sum TimeToCMP for record nos. 1 to 33, their sum is 38.8. Record 34 would put the sum over 40 so you don't want to include it. Therefore, the query would spit out only records 1 to 33. That is for Priority No. 1.

Now for Priority No. 2, their records range from record nos. 345 to 683. For those, records 345 to 369 add up to 39.5. Therefore, the query would spit out not only records 1 to 33, but also 345 to 369.

And so on for the other priorities. Is that right?


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
Reply With Quote