Querying other groupby queries

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
 
J

John Vinson

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top