Toggle Side Panel

  • Home
  • Articles
    • All Articles
    • Blogs
    • Videos
    • Infographics
  • 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
  • Marketplace
  • Advertise With Us
  • Contact Us
  • Discussions
More options
    Sign in Sign up
    • Home
    • Articles
      • All Articles
      • Blogs
      • Videos
      • Infographics
    • 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
    • Marketplace
    • Advertise With Us
    • 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 7 years, 11 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

    application solution

    Popular Salesforce Blogs

    Automation for Managing Supplier and Partner Experiences | Salesforce

    Blog in Salesforce

    Like many business practices in different organizations, supplier management has seen major transitions over the last few years because of growth in technology and the…

    Automate Reminders, Automation, Automation for Managing Supplier, Automation Monitoring, Business
    360 Degree Oct 18, 2021
    2,225  Views
    Integrating RPA With Salesforce

    Integrating RPA With Salesforce: A Step Towards Revolutionizing Business Operations

    Blog in Salesforce integration

    Today, businesses are investing in CRMs to smoothly run their operations and delight their customers. However, managing any CRM software efficiently is a tall order.…

    API, API Management, APIs, Artificial Intelligence, Automate Business Processes
    Grazitti Mar 8, 2022
    2,719  Views
    Financial Services & Banking: Why Choose Salesforce Consulting Services?

    Financial Services & Banking: Why Choose Salesforce Consulting Services?

    Blog in Salesforce, Salesforce Consultant

    In 2025, digital banking has reached over 1.75 billion users worldwide, and more than 76% of Americans now use mobile banking apps. Salesforce reported annual…

    Salesforce, Services
    Morgan Sep 9, 2025
    447  Views

    Popular Salesforce Videos

    How To Become A Salesforce Administrator | Salesforce Administrator Training

    How To Become A Salesforce Administrator | Salesforce Administrator Training

    Video in Salesforce Admin

    This "How to become a Salesforce Administrator" video will help you understand who is a Salesforce Administrator and what are their roles and responsibilities. It…

    Salesforce Tutorial, Salesforce Administrator Training, Salesforce Admin, Salesforce Video, Salesforce Learning
    Rupal Kakkar May 21, 2021
    1,507  Views
    How to Build an Offline Salesforce App, Part 1: Authenticate with Salesforce

    How to Build an Offline Salesforce App, Part 1: Authenticate with Salesforce

    Video in Salesforce Implementation, Salesforce Apps

    This video tutorial will guide you through the following steps: * Integrating the Salesforce connector * Modifying the login screen and process * Authenticating with…

    salesforce training videos for beginners, Salesforce Beginner Tutorial, Salesforce Tutorial for Beginners, Salesforce Apps, Salesforce Data Management
    Jogender Mar 7, 2018
    2,356  Views
    How to Get a Job in Salesforce as a Fresher | Video Guide

    How to Get a Job in Salesforce as a Fresher | Video Guide

    Video in Salesforce Training, Salesforce Admin

    Looking to start a career in Salesforce. Wondering how to get a job in Salesforce as a fresher. Check out this video it will guide…

    Salesforce Training, Salesforce Tutorial, Salesforce Jobs, salesforce, Salesforce Video
    Apex Dec 13, 2022
    1,760  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®.

    Try AuditMyCRM - It is a Salesforce CRM Audit tool which comprehensively scans your Salesforce org and gives you the list of errors or warnings you need to take care of.
    We use cookies to enhance your browsing experience. Please see our privacy policy if you'd like more information on our use of cookies.