You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by tm...@apache.org on 2008/01/30 14:14:01 UTC
svn commit: r616747 - /db/derby/docs/trunk/src/ref/rrefselectexpression.dita
Author: tmnk
Date: Wed Jan 30 05:14:00 2008
New Revision: 616747
URL: http://svn.apache.org/viewvc?rev=616747&view=rev
Log:
- DERBY-2239 Example of SelectExpression for GROUP BY clause is mistaken - Patch by Jazarine Jamal(jazarine at gmail dot com)
Modified:
db/derby/docs/trunk/src/ref/rrefselectexpression.dita
Modified: db/derby/docs/trunk/src/ref/rrefselectexpression.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/rrefselectexpression.dita?rev=616747&r1=616746&r2=616747&view=diff
==============================================================================
--- db/derby/docs/trunk/src/ref/rrefselectexpression.dita (original)
+++ db/derby/docs/trunk/src/ref/rrefselectexpression.dita Wed Jan 30 05:14:00 2008
@@ -58,10 +58,10 @@
-- 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)
+SELECT COUNT(*),WORK_DEPT,AVG(SALARY)
FROM EMPLOYEE
- GROUP BY WORKDEPT
- ORDER BY 1</b></codeblock></p> <p>If there is no GROUP BY clause, but
+ GROUP BY WORK_DEPT
+ ORDER BY 3</b></codeblock></p> <p>If there is no GROUP BY clause, but
a <i>SelectItem</i> contains an aggregate not in a subquery, the query is
implicitly grouped. The entire table is the single group.</p> <p>The HAVING
clause restricts a grouped table, specifying a search condition (much like