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 › 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 9 years, 7 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

    application solution

    Popular Salesforce Blogs

    10 Ways Salesforce Revenue Cloud can Drive the B2B Buying Experience

    Blog in Salesforce Products

    We are living in a changed world. The pandemic has disrupted sales channels and customer demands. The need for technology to accelerate revenue generation, unify processes…

    AppExchange, Automation, B2B, B2B Buying Experience, B2B Revenue Process
    LevelShift (formerly DemandBlue) Sep 17, 2021
    3,857  Views
    Data Management

    Data Management in Salesforce - Here is All You Need to Know

    Blog in Data, Salesforce

    This is the important part to understand clearly as an administrator. In this blog we are going to learn about how the data is imported…

    Backup Data, Client Application, Configuration, Custom Fields, Custom Objects
    Shivam Apr 4, 2022
    2,957  Views
    data security in salesforce

    Best Practices for Data Security in Salesforce

    Blog in Others, Salesforce Security

    When we deal with data security in Salesforce, we are essentially talking about securing our data from unauthorized access. There might be an environment with…

    Data Security, Default Internal Access, Field Level Security, Manual Sharing, Object access
    Anurag algoworks May 15, 2020
    13,018  Views

    Popular Salesforce Videos

    Introduction to Salesforce Commerce Cloud for Developers

    Introduction to Salesforce Commerce Cloud for Developers

    Video in Salesforce Cloud Platform

    Commerce Cloud powers e-commerce for many of the world's leading brands and it represents a great opportunity for developers around the world. Join us to…

    Salesforce Products, salesforce training videos for beginners, Salesforce Certification, Salesforce Commerce Cloud, Salesforce Commerce Cloud Tutorials
    Shiv Kumar Sharma Jan 17, 2018
    6,556  Views
    Translation Workbench | Salesforce Tutorial

    Translation Workbench | Salesforce Tutorial

    Video in Others, Salesforce Training

    One of the most common questions new Salesforce admins ask us is how can they translate custom terms when their org is in multiple languges?…

    Salesforce Training, Salesforce Tutorial, Salesforce Admins, Salesforce Video, Salesforce Learning
    Stimulus Consulting Oct 1, 2020
    2,405  Views
    How Admins Can Improve Salesforce Data Quality

    How Admins Can Improve Salesforce Data Quality

    Video in Data, Salesforce Training

    Learn how to diagnose the accuracy of your data and build a plan to maintain and enhance its’ quality using Salesforce tools. Follow along to…

    Salesforce Training, Salesforce Tutorial, Salesforce Tools, Data Quality, Admins
    Prafull Jun 10, 2022
    2,238  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.