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

    Salesforce Experience Cloud Overview: Part 1

    Blog in Salesforce Cloud Platform

    Salesforce Experience Cloud is a powerful platform designed for creating and managing websites, portals, and online communities. It helps businesses enhance engagement with customers, partners,…

    Content Management Tool, Salesforce Customization, Salesforce Development, Salesforce Experience Cloud
    Sparkybit Aug 1, 2025
    401  Views

    Why Integrate SAP with Salesforce in 2024?

    Blog in Salesforce Tutorial

    While SAP-Salesforce integration can improve operations and data flows, it can also present challenges such as data silos and duplicate data entry. This guide, written…

    api-integration, Competitive Advantage, Customer Interactions, Data Mapping, Event-Based Integration
    Routine Automation May 16, 2024
    886  Views
    salesforce devops

    Where is Salesforce DevOps Heading? Is it the Future, and if so How?

    Blog in Salesforce

    Salesforce DevOps is distinct. It enables efficiency and collaboration among shareholders that some other platforms just cannot provide. It’s not as if DevOps is extremely different from…

    Automated Deployments, B2B IT Firm, CI Technologies, CI Tools, Code Development
    Algoworks Jul 12, 2022
    2,445  Views

    Popular Salesforce Videos

    Salesforce - How Small Businesses Offer Great Customer Service

    Salesforce - How Small Businesses Offer Great Customer Service

    Video in Others, Salesforce Stories, Sales

    Small businesses are more than capable of offering great customer service, even without having a big call center or multiple service agents on hand. For…

    salesforce, CRM, Salesforce Video, Customer Relationship Management, customer service
    Pooja Sep 7, 2020
    2,246  Views
    Salesforce Admin Certification Questions and Explained Answers with References to Trailblazers

    Salesforce Admin Certification Questions and Explained Answers with References to Trailblazers

    Video in Salesforce Certifications

    A Salesforce Admin Certification is the highest form of recognition a Salesforce Administrator can achieve; it demonstrates expertise in the field as well as a…

    Salesforce Training, Salesforce Tutorial, Salesforce Certification, Salesforce Administrator, Salesforce Video
    Jogender Jun 9, 2021
    1,930  Views
    Slack "Work In Progress" Commercial | Where the Future Works | Success Anywhere | Salesforce

    Slack "Work In Progress" Commercial | Where the Future Works | Success Anywhere | Salesforce

    Video in Salesforce Stories

    We are HERE. The future? We made it! Maybe it's not quite what we envisioned, but here's the thing: the future is forward movement from…

    Salesforce Training, salesforce, Salesforce Video, Salesforce Learning, Slack
    Pooja Aug 18, 2021
    1,849  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.