function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Shubham SengarShubham Sengar 

SOQL Problem 1


Give me all the duplicate accounts for an Account 123??

Select  count(id)
from Account
Where Name = 123
Group by Name
Having Count(id) > 1


its give error..
 
Best Answer chosen by Shubham Sengar
Neetu_BansalNeetu_Bansal
Hi,

Use 123 as string like this:
Select count(id) from Account Where Name = '123' Group by Name Having Count(id) > 1

If this help, please mark as best answer so will help others also.

Thanks,
Neetu

All Answers

Neetu_BansalNeetu_Bansal
Hi,

Use 123 as string like this:
Select count(id) from Account Where Name = '123' Group by Name Having Count(id) > 1

If this help, please mark as best answer so will help others also.

Thanks,
Neetu
This was selected as the best answer
Shubham SengarShubham Sengar
Thanks neetu