Querying other groupby queries

  • Thread starter Thread starter Razor
  • Start date Start date
R

Razor

Hi,

Is it "unsafe" to write a select query that queries a
couple of aggregate (GroupBy) queries?

Does this cause any side-effects such as Cartesian product-
like repetitions?

Thanks,

Razor
 
Hi,

Is it "unsafe" to write a select query that queries a
couple of aggregate (GroupBy) queries?

It can cause your query to run s l o w l y, but nothing unsafe per se.
Does this cause any side-effects such as Cartesian product-
like repetitions?

Certainly it can, if the query is not joined correctly. Just treat
each Totals query as if it were a table; there should be the
equivalent of a "primary key" - a unique field or group of fields - in
one of them, and a matching "foreign key" in the other. Join by this
(these) field(s) and you should be OK.
 
Back
Top