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, 3 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

    Top 6 Ways To Improve Communication With Customers With CRM | Salesforce

    Blog in Salesforce

    Businesses around the world have faced a sudden jolt due to the outbreak of the pandemic. The economic activities got halted, and everything and every…

    Automate Databases, Automated Emails, Business Success, Businesses, Call Centers
    Fexle Services Jun 3, 2021
    3,366  Views
    Salesforce in Outlook

    How to Configure Salesforce in Outlook | The Developer Guide

    Blog in Coding and Scripting, Others, Salesforce integration

    Salesforce for Outlook is an application we will introduce to our Outlook email customer to assist with keeping the information in a state of harmony…

    Applications, Assignments, Clients, Connections, Contacts
    Ayush Mar 10, 2021
    5,051  Views
    Benefits of salesforce native application for growth of business

    Benefits of Salesforce Native Applications for The Growth of Businesses

    Blog in Salesforce

    Salesforce has emerged as a key player, providing a versatile platform for organizations to manage their customer relationships, streamline processes, and drive growth. One of the…

    Audit Trail, Business Growth, Certifications, Compliance, Cost Efficiency
    DianApps Feb 23, 2024
    949  Views

    Popular Salesforce Videos

    Salesforce Summer '18 Release

    Salesforce Summer '18 Release

    Video in Salesforce Products

    I can’t believe Summer ’18 is already here in no time. I don’t know about all of you, but I still have my winter stuff…

    Salesforce Products, Salesforce Lightning Experience, Salesforce Einstein, Machine Learning, Salesforce Release Management
    Shiv Kumar Sharma May 5, 2018
    1,948  Views
    Developing an Automated Salesforce Data Quality Process

    Developing an Automated Salesforce Data Quality Process

    Video in Salesforce Implementation, Salesforce Automation

    Learn how to create a harmonious and automated Salesforce data quality process with easy to customize tools and best practices. Beginning with the identification of…

    Salesforce Developer, Process Automation, Salesforce Administrator, Salesforce Data Management, Data Management In Salesforce
    Hazel Feb 6, 2018
    1,908  Views
    Salesforce Stock Pops on Better-than-expected Earnings and Guidance

    Salesforce Stock Pops on Better-than-expected Earnings and Guidance

    Video in Salesforce Stories

    Salesforce shares rose as much as 3% in extended trading on Wednesday after the enterprise software maker reported fiscal second-quarter earnings and forward guidance that…

    salesforce, Salesforce Video, Tableau, Service Cloud, data analytics
    Nauman Aug 26, 2021
    1,506  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

    © 2025 - 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.