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

    Digital Adoption Platforms

    How Digital Adoption Platforms for Salesforce Enable Digital Transformation

    Blog in Salesforce, Salesforce Products

    As technology is advancing, it has become important for organizations to adopt the latest, state-of-the-art software systems. However, these software systems are only good if…

    App, Application, Business Process, Business Success, Customer adoption
    Grazitti Sep 28, 2022
    3,156  Views
    Change Set

    Deploying Custom Field and Custom Object Through Change Set | Salesforce Developer Guide

    Blog in Others, Salesforce

    In this top salesforce blog, we will be discussing, Deploying Custom Field and Custom Object Through Change set in salesforce. The fields can be sorted…

    Change Set, Component Type, Create a Custom Object, Create Custom Field, Create Custom Object
    Ratnesh Feb 24, 2021
    48,876  Views

    5 Things you Should know before Implementing Salesforce SalesCloud

    Blog in Salesforce

    Salesforce is known as the world’s #1 CRM application. This powerful customer relationship management solution is intuitive, flexible, scalable, and complex and it’s constantly getting better.…

    Business Objectives, Business Operations, Certified Salesforce Implementation Partners, Complete View, Connect
    Variance InfoTech Jul 5, 2023
    1,396  Views

    Popular Salesforce Videos

    Salesforce Lightning Training - Creating Hello World Lightning Component

    Salesforce Lightning Training - Creating Hello World Lightning Component

    Video in Lightning, Salesforce Training

    Data Loader is a utility to perform bulk database operation. Recently Salesforce has changed the way data loaders need to be install. I explain end…

    Salesforce Training, Salesforce Lightning, salesforce, Salesforce Lightning Training, Salesforce Video
    Sam J Apr 28, 2020
    2,548  Views
    Salesforce Administrator and Developer Training | Salesforce Training Videos

    Salesforce Administrator and Developer Training | Salesforce Training Videos

    Video in Salesforce Training

    This Salesforce Training video is a demo of how the live online instructor-led classes take place after you enroll for the Online Classroom. All training…

    Salesforce Training, Salesforce Certification, Salesforce Admin Training, Salesforce Administrator, Salesforce Course
    Simplilearn Apr 23, 2019
    2,094  Views
    1st Year as a Salesforce Business Analyst

    1st Year as a Salesforce Business Analyst

    Video in Salesforce Consultant

    If you are interested in a Salesforce Career, check out Talent Stacker. This is what I used when I first started and ended up joining…

    Salesforce Training, Salesforce Tutorial, Salesforce Jobs, salesforce, Salesforce Ecosystem
    Rupal Kakkar Feb 3, 2022
    2,449  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.