You need to sign in to do that
Don't have an account?

The equivalent of "distinct" in SOQL does not work
I need to run a query but do not must return account id duplicated.
I followed these articles:
but this gives an error:
what do I need to change in my query to she works?
I followed these articles:
- https://developer.salesforce.com/forums/?id=906F00000008yzrIAA
- https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select_groupby.htm
SELECT Id, AccountId FROM Asset GROUP BY AccountId
but this gives an error:
[MALFORMED_QUERY] Field must be grouped or aggregated: Id
what do I need to change in my query to she works?
SELECT Max(Id), AccountId FROM Asset GROUP BY AccountId
All Answers
please try SELECT AccountId FROM Asset GROUP BY AccountId
Please use below line:-
if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh
SELECT Max(Id), AccountId FROM Asset GROUP BY AccountId