Re: Real world issue: How to "split" queries in presence of record replication and replication sensitive aggregate functions ?
Date: 16 Sep 2006 13:00:53 -0700
Message-ID: <1158436853.002537.22720_at_d34g2000cwd.googlegroups.com>
Marshall ha scritto:
> When I say "as small as possible" I literally mean that the
> removal of even one table, or one column, or even just one
> row would not demonstrate the issue any more.
Here one small example I can think of.
3 tables
ONE
Table: TRANS
Table: SUBTRANS
David has 1 fact and Marshall 2 facts.
"questionable" select:
SELECT
The minimum number of table is probably 3 because:
1 table: it's impossible to duplicate values
2 tables in 1-N relationship: placing a function on the dimension table
would probably be too artificious an example
|
TRANS
|
SUBTRANS
Table: ONE
Name
David
Marshall
Name Item Fact
David IT2 1
Marshall IT1 1
Marshall IT1 1
Item SubFact
IT1 1
IT2 1
IT2 1
IT2 1
Report:
One.[Name] AS [Name],
count(Trans.Fact) AS [FactCount],
count(SubTrans.SubFact) AS [SubFactCount]
One.[Name] AS [Name],
count(Trans.Fact) AS [FactCount],
count(SubTrans.SubFact) AS [SubFactCount]
FROM
One,
Trans,
SubTrans
WHERE
One.[Name] = Trans.[Name] AND
Trans.Item = SubTrans.Item
GROUP BY
One.[Name];
>
>
> The following is quite blunt, but it could help you a lot:
>
> How To Ask Questions The Smart Way
>
> http://www.catb.org/~esr/faqs/smart-questions.html
quite massive. I will be spending the night with it :) : may save some
in future ...
Thanks
-P
> Marshall
Received on Sat Sep 16 2006 - 22:00:53 CEST