in reply to Re: an efficient program?
in thread an efficient program?
If that's really what you want/need to do, then Errto's pretty well nailed it - you're describing a slightly-filtered Cartesian join. You'll get the least-bad performance by doing it in the database with SQL similar to what he suggested, but I'd advise you to first take a hard look at whether there is any other way to accomplish your actual goal, because, if you have a lot of groupings and you combine each record with all records in every other grouping, then you're looking at having to process billions of combinations.
|
|---|