Toggle Side Panel

  • Blogs
  • Consultants
    • Salesforce Product Expertise
      • Top Salesforce ConsultantsTop Salesforce Consultants
      • Marketing Cloud ConsultantsMarketing Cloud Consultants
      • Service Cloud ConsultantsService Cloud Consultants
      • Experience Cloud ConsultantsExperience Cloud Consultants
      • Analytics Cloud ConsultantsAnalytics Cloud Consultants
    • Salesforce Industry Expertise
      • Non-Profit Cloud ConsultantsNon-Profit Cloud Consultants
      • Financial Service Cloud ConsultantsFinancial Service Cloud Consultants
      • Health Cloud ConsultantsHealth Cloud Consultants
      • Commerce Cloud ConsultantsCommerce Cloud Consultants
      • Manufacturing Cloud ConsultantsManufacturing Cloud Consultants
    • Salesforce Experts by Location
      • USATop Salesforce Consultants in USA
      • IndiaTop Salesforce Consultants in India
      • AustraliaTop Salesforce Consultants in Australia
      • United KingdomTop Salesforce Consultants in UK
      • CanadaTop Salesforce Consultants in Canada
  • Webinars
  • Contact Us
  • Discussions
More options
    Sign in Sign up
    • Blogs
    • Consultants
      • Salesforce Product Expertise
        • Top Salesforce ConsultantsTop Salesforce Consultants
        • Marketing Cloud ConsultantsMarketing Cloud Consultants
        • Service Cloud ConsultantsService Cloud Consultants
        • Experience Cloud ConsultantsExperience Cloud Consultants
        • Analytics Cloud ConsultantsAnalytics Cloud Consultants
      • Salesforce Industry Expertise
        • Non-Profit Cloud ConsultantsNon-Profit Cloud Consultants
        • Financial Service Cloud ConsultantsFinancial Service Cloud Consultants
        • Health Cloud ConsultantsHealth Cloud Consultants
        • Commerce Cloud ConsultantsCommerce Cloud Consultants
        • Manufacturing Cloud ConsultantsManufacturing Cloud Consultants
      • Salesforce Experts by Location
        • USATop Salesforce Consultants in USA
        • IndiaTop Salesforce Consultants in India
        • AustraliaTop Salesforce Consultants in Australia
        • United KingdomTop Salesforce Consultants in UK
        • CanadaTop Salesforce Consultants in Canada
    • Webinars
    • Contact Us
    • Discussions
    Close search

    Activity › Forums › Salesforce® Discussions › Salesforce Query to Get the list of accounts where Related contacts Greater than 200

    Tagged: Account List, Account List in Salesforce, Accounts in Salesforce, Contact List in Salesforce, Contact Object, Contact Record, Salesforce List, Salesforce Object Query Language, Salesforce Query

    • Salesforce® Discussions

      Salesforce Query to Get the list of accounts where Related contacts Greater than 200

      Posted by subramanyam subbu on January 31, 2018 at 3:40 PM

      hi all,

      Is it possible to write a query to get a list of accounts where associated contacts greater than 200?

      Mohit replied 8 years, 8 months ago 2 Members · 1 Reply
      • Account List
      • Account List in Salesforce
      • Accounts in Salesforce
      • Contact List in Salesforce
      • Contact Object
      • Contact Record
      • Salesforce List
      • Salesforce Object Query Language
      • Salesforce Query
    • 1 Reply
    • Mohit

      Member
      February 1, 2018 at 9:38 AM

      Hi Subramanyam Subbu,
      Yes, it is possible to query the list of Accounts where Associated Contacts greater than 200.
      For this, we can use the Aggregate query to fetch the AccountId of those Account record having related contact greater than 200.
      Here is the Code below:-

      AggregateResult[] groupedResults = [select AccountID from Contact GROUP BY AccountID HAVING count(AccountId)>200];

      for (AggregateResult ar : groupedResults) {

      System.debug('Account ID' + ar.get('AccountID'));

      }
      Hope this may help you.

      Thanks,
      Mohit Agarwal

    Log In to reply.

    • Public
    • All Members
    • My Connections
    • Only Me
    • Public
    • All Members
    • My Connections
    • Only Me
    • Public
    • All Members
    • My Connections
    • Only Me

    Popular Salesforce Blogs

    Guide On How To Implement Salesforce For Better Results

    A Complete Guide On How To Implement Salesforce For Better Results

    Blog in Others, Salesforce Implementation

    Salesforce implementation is of key importance for any company, big or small, and no matter what their specific needs and preferences are. Being one of…

    CRM Solutions, CRM System, Customer Relationship Management, Customer Service, Customer Support Platform
    William Oct 11, 2018
    3,516  Views

    Salesforce Releases New Google and LinkedIn Data Cloud Integration

    Blog in Salesforce

    Salesforce has just released new Data Cloud integrations for Google and LinkedIn. Salesforce users can utilize these integrations to merge first-party data from Salesforce's #1…

    Cloudmetic Feb 6, 2024
    1,530  Views

    Salesforce Consulting Services: How can you Achieve your Business Goals in 2023?

    Blog in Salesforce

    Salesforce is a popular CRM solution. According to reports, Salesforce has helped clients increase their revenue by 25%. Salesforce technology places a strong emphasis on creating a…

    B2B, B2B Organizations, B2B Quoting Process, Benefits of Salesforce, Best Tools
    Hennery cavil Jan 27, 2023
    3,620  Views

    Popular Salesforce Videos

    What is Salesforce

    What is Salesforce

    Video in Salesforce1

    Discover Salesforce, the world’s leading CRM platform! Learn how it helps businesses manage customer relationships, automate workflows, and grow. We’ll explore its ecosystem—Sales Cloud, Service…

    salesforce, #LearnSalesforce, #salesforceimplementation, #crmsolutions
    Elastik Sep 5, 2025
    228  Views
    Direct Messaging In Salesforce | Salesforce Lightning

    Direct Messaging In Salesforce | Salesforce Lightning

    Video in Lightning

    Salesforce has addressed the main challenge retailers face is replicating the one-to-one in-store interactions with their customers, and supporting a seamless buying experience. Resolving these…

    Salesforce Tutorial, Salesforce Lightning, salesforce, Salesforce Video, Customers
    Algoworks Aug 3, 2021
    3,117  Views
    Custom Settings and Custom Metadata Explained | 3-Minute | Salesforce Tutorial

    Custom Settings and Custom Metadata Explained | 3-Minute | Salesforce Tutorial

    Video in Salesforce Development

    In this video, Alex walks you through Custom Settings and Custom Metadata types in Salesforce and the difference between them. Discover how ENWAY can assist…

    Apex, Custom Settings in Salesforce, Metadata, Custom Setting, Custom Metadata Types
    ENWAY Nov 24, 2023
    1,019  Views
    Footer Forcetalks logo

    support@forcetalks.com

    • twitterx

    Quick Links

    Advertise with Us

    Salesforce® Articles

    Dreamforce 2023

    Top Salesforce® Bloggers 2023

    Top Salesforce Consultants

    Get Listed

    Company

    Contact Us

    About Us

    Privacy Policy

    Terms & Conditions

    InsightHub

    Salesforce Blogs

    Salesforce Videos

    Salesforce Groups

    Salesforce Jobs

    © 2026 - Forcetalks ● All Rights Reserved

    Salesforce® is a trademark of Salesforce® Inc. No claim is made to the exclusive right to use “Salesforce”. Any services offered within the Forcetalks website/app are not sponsored or endorsed by Salesforce®.

    We use cookies to enhance your browsing experience. Please see our privacy policy if you'd like more information on our use of cookies.