Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Group by and Count
Message
From
15/09/2021 15:12:58
 
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
01682285
Message ID:
01682292
Views:
36
>Naomi gave you the answer, but just to jump in as well....anytime you have a pattern of two or more 1-many relationships and you're doing aggregations against multiple child tables, you must break it up into multiple subqueries, or multiple temporary result sets. Otherwise you'll get over-aggregation of the answers.

Thanks, yes, this is exactly what I did. I now have a query which is more easy to read and it does the job pretty good.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Reply
Map
View

Click here to load this message in the networking platform