Derby
  1. Derby
  2. DERBY-2239

Example of SelectExpression for GROUP BY clause is mistaken

    Details

    • Issue & fix info:
      Patch Available

      Description

      There is next example.

      – List head count of each department,
      – the department number (WORKDEPT), and the average departmental salary (SALARY)
      – for all departments in the EMPLOYEE table.
      – Arrange the result table in ascending order by average departmental salary.
      SELECT WORKDEPT, AVG(SALARY)
      FROM EMPLOYEE
      GROUP BY WORKDEPT
      ORDER BY 1

      Comment told that head count of each department is listed, but not exaxtly.
      I think count is needed here.

      1. DERBY2239-ref.diff
        0.9 kB
        Jazarine Jamal
      2. newref.zip
        799 kB
        Jazarine Jamal

        Activity

        Hide
        Dyre Tjeldvoll added a comment -

        This issue has no fix version, but has been checked in to trunk after the 10.3 branch was cut, and has not been merged to the 10.3 branch (before the last release).
        (Some have been checked into trunk after 10.4 was cut and then merged to 10.4).

        Show
        Dyre Tjeldvoll added a comment - This issue has no fix version, but has been checked in to trunk after the 10.3 branch was cut, and has not been merged to the 10.3 branch (before the last release). (Some have been checked into trunk after 10.4 was cut and then merged to 10.4).
        Hide
        Tomohito Nakayama added a comment -

        I committed.

        Sending src/ref/rrefselectexpression.dita
        Transmitting file data .
        Committed revision 616747.

        Show
        Tomohito Nakayama added a comment - I committed. Sending src/ref/rrefselectexpression.dita Transmitting file data . Committed revision 616747.
        Hide
        Tomohito Nakayama added a comment -

        I checked three kind output of singlepage,multi page and PDF.
        There were no problem and I will commit it.

        Show
        Tomohito Nakayama added a comment - I checked three kind output of singlepage,multi page and PDF. There were no problem and I will commit it.
        Hide
        Jazarine Jamal added a comment -

        I have made changes to the file trunk/src/ref/rrefselectexpression.dita.

        The following lines :

        SELECT WORKDEPT, AVG(SALARY)
        FROM EMPLOYEE
        GROUP BY WORKDEPT
        ORDER BY 1

        have been replaced with:

        SELECT COUNT,WORK_DEPT,AVG(SALARY)
        FROM EMPLOYEE
        GROUP BY WORK_DEPT
        ORDER BY 3;

        I build the new file with ant html and the resulting html page: rrefselectexpression.html contains the corrected code.

        The file newref.zip contains the corrected page. Please have a look at it.

        Show
        Jazarine Jamal added a comment - I have made changes to the file trunk/src/ref/rrefselectexpression.dita. The following lines : SELECT WORKDEPT, AVG(SALARY) FROM EMPLOYEE GROUP BY WORKDEPT ORDER BY 1 have been replaced with: SELECT COUNT ,WORK_DEPT,AVG(SALARY) FROM EMPLOYEE GROUP BY WORK_DEPT ORDER BY 3; I build the new file with ant html and the resulting html page: rrefselectexpression.html contains the corrected code. The file newref.zip contains the corrected page. Please have a look at it.
        Hide
        Tomohito Nakayama added a comment -

        I think that change is right.

        Show
        Tomohito Nakayama added a comment - I think that change is right.
        Hide
        Jazarine Jamal added a comment -

        I just looked upon this documentation and reproduced it in ij...
        I have this proposed changes:

        SELECT COUNT,WORK_DEPT,AVG(SALARY)
        FROM EMPLOYEE
        GROUP BY WORK_DEPT
        ORDER BY 3;

        Please provide feedback on this.

        Show
        Jazarine Jamal added a comment - I just looked upon this documentation and reproduced it in ij... I have this proposed changes: SELECT COUNT ,WORK_DEPT,AVG(SALARY) FROM EMPLOYEE GROUP BY WORK_DEPT ORDER BY 3; Please provide feedback on this.
        Hide
        Tomohito Nakayama added a comment -

        I think next description is not correct in the example ....

        – Arrange the result table in ascending order by average departmental salary.

        1 is for WORKDEPT and not AVG(SALARY).

        Show
        Tomohito Nakayama added a comment - I think next description is not correct in the example .... – Arrange the result table in ascending order by average departmental salary. 1 is for WORKDEPT and not AVG(SALARY).

          People

          • Assignee:
            Jazarine Jamal
            Reporter:
            Tomohito Nakayama
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development