You need to sign in to do that
Don't have an account?
How can we use result of sub query which uses Group By and Having in main query ?
Hi,
I am working on a query where I have to count distinct values from inside query in related object using Group By and Having and use that value in main query.
For example :
select Firstname from Contact where Account.Name in (
SELECT Name
FROM Account
GROUP BY Name
HAVING Count(Id) = 1)
This query is throwing error : "Unknown error parsing query"
I am working on a query where I have to count distinct values from inside query in related object using Group By and Having and use that value in main query.
For example :
select Firstname from Contact where Account.Name in (
SELECT Name
FROM Account
GROUP BY Name
HAVING Count(Id) = 1)
This query is throwing error : "Unknown error parsing query"
https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/