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

soql query to get records with same account name
I have to create a soql query on accounts object, to get the records with same account name.
You need to sign in to do that
Don't have an account?
Anyway for your referance(As per my understanding of your Qn)
List<Account> lacc=new List<Account>();
lacc=[select id,name form Account where name='saurabh sharma'];
Hope it helps U
List<AggregateResult> result = [SELECT Name, count(Id) FROM Account GROUP BY Name Having count(Id)>1];