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 › How can I use GROUP BY and ORDER BY in a single query?

    Tagged: Account, Salesforce Query, Salesforce Records

    • Salesforce® Discussions

      How can I use GROUP BY and ORDER BY in a single query?

      Posted by PRANAV on August 19, 2016 at 1:19 PM

      Hi All,

      How can I use Group By and Order By in a single query?

      As I want to group the account records and ordered it by their id.

      Thanks

      Piyush replied 10 years, 2 months ago 2 Members · 1 Reply
      • Account
      • Salesforce Query
      • Salesforce Records
    • 1 Reply
    • Piyush

      Member
      August 22, 2016 at 12:24 PM

      Hello ,

      You can use GROUP BY and ORDER BY in a single query. Here is the sample of Query :-

      SELECT Name  FROM Account GROUP BY name ORDER BY Name LIMIT 2

      Thanks.

    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

    Salesforce Apex Scheduler

    All you Need to Know About Salesforce Apex Scheduler | The Ultimate Guide

    Blog in Salesforce Apex

    Apex Scheduler Apex code that is scheduled to run at a specific time over a set period of time. A class that repeats at regular…

    Apex Scheduler, App Subscription, App Subscription User Licences, Asynchronous Apex, Batch Apex
    kushagra saini Sep 27, 2022
    4,426  Views

    6 Best Practices While Implementing Salesforce Sales Cloud

    Blog in Sales, Salesforce Cloud Platform

    Sales Cloud is one of the most prominent offerings in the Salesforce ecosystem and has a proven track record of transforming the sales pipeline and…

    API, AppExchange Apps, Automated Workflows, Built-in APIs, Business Needs
    Carol May 6, 2022
    5,441  Views
    Top 10 Salesforce Tips to Makes Things Easier in 2018

    Top 10 Salesforce Tips to Make Things Easier!

    Blog in Salesforce Certifications, Salesforce Training

    Newbie in Salesforce and finding it a great deal to use the robust and complicated system? Well, there are often experiences of fear and hesitation…

    Chrome Extensions, Online Salesforce Training, Salesforce, Salesforce Certification, Salesforce Certified
    Nirmal Jul 26, 2018
    2,965  Views

    Popular Salesforce Videos

    Scheduled Actions Workflow Rules, Process Builder and Lightning Flow

    Scheduled Actions Workflow Rules, Process Builder and Lightning Flow

    Video in Lightning

    Time-dependent actions are executed at a specific time, such as 10 days before a record's close date. When that specific time passes, the workflow rule…

    Salesforce Lightning, salesforce, Process Builder, Salesforce Video, Salesforce Learning
    Nauman May 19, 2020
    2,735  Views
    What can Salesforce Service Cloud do for your Businesses

    What can Salesforce Service Cloud do for your Businesses

    Video in Salesforce Cloud Platform

    Salesforce Service Cloud allows you to Streamline Workflow, Automate Service Processes, and Surface Key Topics, Articles, and Experts to transform the agent experience. It simplifies…

    Salesforce Training, Salesforce Tutorial, Salesforce Service Cloud, Salesforce Applications, Salesforce Video
    Algoworks Nov 22, 2021
    2,264  Views
    Salesforce Integration Tutorial | Integrate Salesforce with Apps

    Salesforce Integration Tutorial | Integrate Salesforce with Apps

    Video in Salesforce Integration

    This "?????????? ??????????? ????????" video by Edureka will help you understand what is Salesforce integration in detail. It will also address the various Salesforce integration…

    Salesforce Training, Salesforce Tutorial, Salesforce Integration, salesforce, Salesforce Integration Tutorial
    Pooja Feb 14, 2022
    4,509  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.