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

    Make your Salesforce life easy with Salesforce advanced code searcher and ORGanizer for Salesforce

    Make your Salesforce life easy with Salesforce advanced code searcher and ORGanizer for Salesforce

    Blog in Others

    Salesforce advanced code searcher and ORGanizer for Salesforce, both are google chrome's extensions which adds an extra features to your salesforce org. Salesforce advanced code…

    Apex Triggers, Custom Objects, Developer Console, Email Templates, extensions
    shariq Sep 12, 2018
    11,127  Views
    Salesforce Wave

    Salesforce Wave: The New Salesforce Analytics Platform

    Blog in Analytics, Salesforce

    For those who missed the Dreamforce keynotes or the highlights of the marketing and promotional campaigns by Salesforce teams, here is a quick one-line summary…

    CRM Product, Dashboard Customizations, Dreamforce, Mobile First Platform, NoSQL
    Algoworks Oct 27, 2017
    5,590  Views

    Review of Top 5 Free Salesforce Data Cleansing Tools [+ Salesforce Data Cleansing Best Practices]

    Blog in Salesforce Data integration

    Keeping your CRM data clean is not only a technical activity. It also involves a creative mind, time, and deep knowledge of the business nuances…

    API, AppExchange, Ascendix Search App for Salesforce, Automated Data Cleansing, Bad data
    Angie Sep 21, 2021
    3,012  Views

    Popular Salesforce Videos

    Salesforce Announces New Salesforce CDP Updates | Salesforce CDP

    Salesforce Announces New Salesforce CDP Updates | Salesforce CDP

    Video in Salesforce Products

    Salesforce, one of the largest global providers of CRM solutions, launched Salesforce CDP last year. Salesforce Customer Data Platform is an enterprise customer data platform…

    salesforce, Salesforce Video, Salesforce Learning, Customer Data, Salesforce News
    nakul singh May 31, 2021
    2,015  Views
    What is the Future of Salesforce Developer?

    What is the Future of Salesforce Developer?

    Video in Salesforce Development

    Salesforce Developer jobs are on the rise. A lot of MNC companies like TCS, Infosys, Cognizant, etc are hiring Salesforce developers. In this video, Musings…

    Salesforce Training, Salesforce Tutorial, Salesforce Developer, What Is Salesforce, Free Salesforce Training
    Tulika Wadhwani Dec 21, 2022
    1,913  Views
    Getting started with salesforce

    Getting started with salesforce

    Video in Others

    Salesforce is a customer relationship management solution that brings companies and customers together. It's one integrated CRM platform that gives all your departments — including…

    Salesforce Development, salesforce, Salesforce Customization, Salesforce Video, sales
    Bhupendra Rao Jul 3, 2018
    2,024  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.