Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-26466

Some cases aggregate in order by gives error

    XMLWordPrintable

Details

    • Task
    • Resolution: Fixed
    • Major
    • 5.5.0
    • 5.5.0
    • query
    • None

    Description

      FOR GROUP queries If the aggregates present in the ORDER BY ONLY it gives error.
      If there is another aggregate any where in the query and aggregate in the ORDER BY allowed

      CREATE PRIMARY INDEX on default;
       EXPLAIN SELECT p FROM default GROUP BY p ORDER BY SUM(x);
      {
          "errors": [
              {
                  "code": 4000,
                  "msg": "Aggregates not available for this ORDER BY."
              }
          ]
      }
       
      The following works.
       
      EXPLAIN SELECT p, COUNT(y) FROM default GROUP BY p ORDER BY SUM(x);
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Sitaram.Vemulapalli Sitaram Vemulapalli
            Sitaram.Vemulapalli Sitaram Vemulapalli
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty