db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject svn commit: r514156 - in /db/derby/docs/trunk/src/ref: rrefsqlj27781.dita rrefsqlj33520.dita
Date Sat, 03 Mar 2007 13:55:56 GMT
Author: tmnk
Date: Sat Mar  3 05:55:55 2007
New Revision: 514156

URL: http://svn.apache.org/viewvc?view=rev&rev=514156
Log:
- DERBY-2365 Brushing up pages for MAX and MIN in Derby Reference Manual - Patch by Kim Haase
(camilla.haase@sun.com)

Modified:
    db/derby/docs/trunk/src/ref/rrefsqlj27781.dita
    db/derby/docs/trunk/src/ref/rrefsqlj33520.dita

Modified: db/derby/docs/trunk/src/ref/rrefsqlj27781.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/rrefsqlj27781.dita?view=diff&rev=514156&r1=514155&r2=514156
==============================================================================
--- db/derby/docs/trunk/src/ref/rrefsqlj27781.dita (original)
+++ db/derby/docs/trunk/src/ref/rrefsqlj27781.dita Sat Mar  3 05:55:55 2007
@@ -24,13 +24,13 @@
 <keywords><indexterm>MAX aggregate function</indexterm></keywords>
 </metadata></prolog>
 <refbody>
-<section> <p>MAX is an aggregate function that evaluates the maximum of the
-expression over a set of values (see <xref href="rrefsqlj33923.dita#rrefsqlj33923"></xref>).
+<section> <p>MAX is an aggregate function that evaluates the maximum of an
+expression over a set of rows (see <xref href="rrefsqlj33923.dita#rrefsqlj33923"></xref>).
 MAX is allowed only on expressions that evaluate to built-in data types (including
 CHAR, VARCHAR, DATE, TIME, CHAR FOR BIT DATA, etc.).</p></section>
 <refsyn><title>Syntax</title> <codeblock><b>MAX ( [ DISTINCT
| ALL ] <i>Expression</i> )</b></codeblock> <p>The
-DISTINCT qualifier eliminates duplicates. The ALL qualifier retains duplicates.
-These qualifiers have no effect in a MAX expression. Only one DISTINCT aggregate
+DISTINCT and ALL qualifiers eliminate or retain duplicates, but 
+these qualifiers have no effect in a MAX expression. Only one DISTINCT aggregate
 expression per <i><xref href="rrefselectexpression.dita#rrefselectexpression">SelectExpression</xref></i>
is
 allowed. For example, the following query is not allowed:   <codeblock><b>SELECT
COUNT (DISTINCT flying_time), MAX (DISTINCT miles)
 FROM Flights</b></codeblock></p> <p>The <i>Expression</i>
can contain multiple
@@ -38,12 +38,13 @@
 or subquery. It must evaluate to a built-in data type. You can therefore call
 methods that evaluate to built-in data types. (For example, a method that
 returns a <i>java.lang.Integer</i> or <i>int</i> evaluates to an
INTEGER.)
-If an expression evaluates to NULL, the aggregate skips that value.</p> <p>For
-CHAR, VARCHAR, and <xref href="rrefsqlj15147.dita#rrefsqlj15147">LONG VARCHAR</xref>,
+If an expression evaluates to NULL, the aggregate skips that value.</p> 
+<p>The type's comparison rules determine the maximum value. For
+CHAR and VARCHAR,
 the number of blank spaces at the end of the value can affect how MAX is evaluated.
 For example, if the values 'z' and 'z ' are both stored in a column, you cannot
-control which one will be returned as the maximum, because a blank space has
-no value.</p> <p>The resulting data type is the same as the expression on
+control which one will be returned as the maximum, because blank spaces are
+ignored for character comparisons.</p> <p>The resulting data type is the same
as the expression on
 which it operates (it will never overflow).</p> </refsyn>
 <example> <codeblock><b><ph>-- find the latest date in the FlightAvailability
table</ph>
 SELECT MAX (flight_date) FROM FlightAvailability
@@ -56,4 +57,3 @@
 </b></codeblock> </example>
 </refbody>
 </reference>
-

Modified: db/derby/docs/trunk/src/ref/rrefsqlj33520.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/rrefsqlj33520.dita?view=diff&rev=514156&r1=514155&r2=514156
==============================================================================
--- db/derby/docs/trunk/src/ref/rrefsqlj33520.dita (original)
+++ db/derby/docs/trunk/src/ref/rrefsqlj33520.dita Sat Mar  3 05:55:55 2007
@@ -24,7 +24,7 @@
 <keywords><indexterm>MIN aggregate function</indexterm></keywords>
 </metadata></prolog>
 <refbody>
-<section> <p>MIN is an aggregate expression that evaluates the minimum of
+<section> <p>MIN is an aggregate function that evaluates the minimum of
 an expression over a set of rows (see <xref href="rrefsqlj33923.dita#rrefsqlj33923"></xref>).
 MIN is allowed only on expressions that evaluate to built-in data types (including
 CHAR, VARCHAR, DATE, TIME, etc.).</p></section>
@@ -33,14 +33,17 @@
 have no effect in a MIN expression. Only one DISTINCT aggregate expression
 per <i><xref href="rrefselectexpression.dita#rrefselectexpression">SelectExpression</xref></i>
is
 allowed. For example, the following query is not allowed:   <codeblock><b>SELECT
COUNT (DISTINCT flying_time), MIN (DISTINCT miles)
-FROM Flights</b></codeblock></p> <p>The expression can contain multiple
column
+FROM Flights</b></codeblock></p> <p>The <i>Expression</i>
can contain multiple column
 references or expressions, but it cannot contain another aggregate or subquery.
 It must evaluate to a built-in data type. You can therefore call methods that
 evaluate to built-in data types. (For example, a method that returns a <i>java.lang.Integer</i>
or <i>int</i> evaluates
 to an INTEGER.) If an expression evaluates to NULL, the aggregate skips that
-value.</p> <p>The type's comparison rules determine the maximum value. For
-CHAR, VARCHAR, and <xref href="rrefsqlj15147.dita#rrefsqlj15147">LONG VARCHAR</xref>,
-the number of blank spaces at the end of the value can affect the result.</p> <p>The
+value.</p> <p>The type's comparison rules determine the minimum value. For
+CHAR and VARCHAR,
+the number of blank spaces at the end of the value can affect how MIN is evaluated.
+For example, if the values 'z' and 'z ' are both stored in a column, you cannot
+control which one will be returned as the minimum, because blank spaces are
+ignored for character comparisons.</p> <p>The
 resulting data type is the same as the expression on which it operates (it
 will never overflow).</p> </refsyn>
 <example> <codeblock><b><ph>-- NOT valid:</ph>



Mime
View raw message