on 06-08-2009 2:04 PM
Hi,
I'm trying to define in Designer 6.5 an object with the following select: (example)
sum (count (distinct REPORTING.table.object_name))
the SQL parsing restitues me this error --> "The SQL can not perform an aggregate function on an expression containing an aggregate or a subquery".
Can anyboby explain me the problem and above all how to solve it?
Thanks
Riccardo
Hi,
You cannot mix different aggregations functions in the same SQL expression: this is a SQL limitation for all databases.
You need to use subselect to achieve your requirement.
See the following example that works on SQL Server:
Select sum(a._count) from
(Select count (distinct cust_id) as _count from Club.dbo.Customer) a
Regards,
Didier
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.