• Dakota
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies

I am trying to write a single query to get an account record and the count of contacts for the account.  Can this be done?

 

Ex: 

SELECT Name,Id,BillingState, (SELECT count() FROM Contact Where Contact.AccountID = Id) FROM Account WHERE Name like '%Test%'"

 

Thank You

Dakota

 

 

  • March 29, 2011
  • Like
  • 0

I am trying to write a single query to get an account record and the count of contacts for the account.  Can this be done?

 

Ex: 

SELECT Name,Id,BillingState, (SELECT count() FROM Contact Where Contact.AccountID = Id) FROM Account WHERE Name like '%Test%'"

 

Thank You

Dakota

 

 

  • March 29, 2011
  • Like
  • 0