我用列的相同计数将“ Times”除以数...有一种方法可以优化查询,例如:
SELECT
strftime('%W', [DatumEintrag]) Woche ,
SUM([FOO]) / COUNT (DISTINCT [DatumEintrag]),
SUM([BAR]) / COUNT (DISTINCT [DatumEintrag]),
SUM([SOMETHING]) / COUNT (DISTINCT [DatumEintrag]),
SUM([SOMETHINGELSE]) / COUNT (DISTINCT [DatumEintrag])
Material.[ID],
COUNT (DISTINCT [DatumEintrag]) as Tage,
FROM [MainData] JOIN [Material] ON [MainData].MID= [Material].ID
WHERE ([FILTER] = '0015') AND ([MID] IN (156500, 156504)) AND
[VOODOO] = '' AND ...
会
Count(DISTINCT [DatumEintrag])
被处死几次?