db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r633083 - in /db/derby/docs/trunk/src/ref: refderby.ditamap rreffuncrownumber.dita rrefkeywords29722.dita
Date Mon, 03 Mar 2008 13:50:05 GMT
Author: dyre
Date: Mon Mar  3 05:50:04 2008
New Revision: 633083

URL: http://svn.apache.org/viewvc?rev=633083&view=rev
Log:
DERBY-2998: Add support for ROW_NUMBER() window function
Documentation for ROW_NUMBER.
Patch contributed by Thomas Nielsen
Patch file: d2998-doc-2.diff

Added:
    db/derby/docs/trunk/src/ref/rreffuncrownumber.dita   (with props)
Modified:
    db/derby/docs/trunk/src/ref/refderby.ditamap
    db/derby/docs/trunk/src/ref/rrefkeywords29722.dita

Modified: db/derby/docs/trunk/src/ref/refderby.ditamap
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/refderby.ditamap?rev=633083&r1=633082&r2=633083&view=diff
==============================================================================
--- db/derby/docs/trunk/src/ref/refderby.ditamap (original)
+++ db/derby/docs/trunk/src/ref/refderby.ditamap Mon Mar  3 05:50:04 2008
@@ -271,6 +271,7 @@
 <topicref href="rreffuncradians.dita" navtitle="RADIANS function"></topicref>
 <topicref href="rreffuncrandom.dita" navtitle="RANDOM function"></topicref>
 <topicref href="rreffuncrand.dita" navtitle="RAND function"></topicref>
+<topicref href="rreffuncrownumber.dita" navtitle="ROW_NUMBER function"></topicref>
 <topicref href="rrefsqlj32613.dita" navtitle="RTRIM function"></topicref>
 <topicref href="rrefsecondfunc.dita" navtitle="SECOND function"></topicref>
 <topicref href="rrefsqlj25228.dita" navtitle="SESSION_USER function"></topicref>

Added: db/derby/docs/trunk/src/ref/rreffuncrownumber.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/rreffuncrownumber.dita?rev=633083&view=auto
==============================================================================
--- db/derby/docs/trunk/src/ref/rreffuncrownumber.dita (added)
+++ db/derby/docs/trunk/src/ref/rreffuncrownumber.dita Mon Mar  3 05:50:04 2008
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="utf-8"?>
+ 
+<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN"
+ "../dtd/reference.dtd">
+<!-- 
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at      
+
+http://www.apache.org/licenses/LICENSE-2.0  
+
+Unless required by applicable law or agreed to in writing, software  
+distributed under the License is distributed on an "AS IS" BASIS,  
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  
+See the License for the specific language governing permissions and  
+limitations under the License.
+-->
+<reference id="rreffuncrownumber" xml:lang="en-us">
+<title>ROW_NUMBER function</title>
+<shortdesc>The ROW_NUMBER function returns the row number over a named or unnamed window
specification.</shortdesc>
+<prolog><metadata>
+<keywords><indexterm>ROW_NUMBER function</indexterm><indexterm>functions<indexterm>ROW_NUMBER</indexterm><indexterm>LIMIT</indexterm></indexterm>
+</keywords>
+</metadata></prolog>
+<refbody>
+<section> <p>The ROW_NUMBER function does not take any arguments, and for each
row over the window returns an ever increasing BIGINT. It is normally used to limit the number
of rows returned for a query. The LIMIT keyword used in other databases is not defined in
the SQL standard, and is not supported.</p>
+<p>NOTE:<ul>
+<li>Derby does not currently support the named or unnamed window specification to be
specified in the <codeph>OVER()</codeph> clause, but requires an empty parenthesis.
This means the function is evaluated over the entire resultset.</li>
+<li>ROW_NUMBER can currently not be used in a WHERE clause</li>
+</ul></p>
+<p>The data type of the returned value is a BIGINT number.</p> 
+</section>
+
+<refsyn><title>Syntax</title> <codeblock><b>ROW_NUMBER() OVER
()</b></codeblock> </refsyn>
+
+<example><title>Example</title><p>Limiting the number of rows returned
from a query to the 10 first rows of table "T" can be done with the following query:</p>
+<codeblock>
+SELECT * FROM (
+   SELECT 
+     ROW_NUMBER() OVER () AS R, 
+     T.* 
+   FROM T
+) AS TR 
+   WHERE R &lt;= 10; 
+</codeblock>
+</example>
+</refbody>
+</reference>

Propchange: db/derby/docs/trunk/src/ref/rreffuncrownumber.dita
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: db/derby/docs/trunk/src/ref/rrefkeywords29722.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/rrefkeywords29722.dita?rev=633083&r1=633082&r2=633083&view=diff
==============================================================================
--- db/derby/docs/trunk/src/ref/rrefkeywords29722.dita (original)
+++ db/derby/docs/trunk/src/ref/rrefkeywords29722.dita Mon Mar  3 05:50:04 2008
@@ -169,6 +169,7 @@
 <sli>ORDER</sli>
 <sli>OUTER</sli>
 <sli>OUTPUT</sli>
+<sli>OVER</sli>
 <sli>OVERLAPS</sli>
 <sli>PAD</sli>
 <sli>PARTIAL</sli>
@@ -188,6 +189,7 @@
 <sli>RIGHT</sli>
 <sli>ROLLBACK</sli>
 <sli>ROWS</sli>
+<sli>ROW_NUMBER</sli>
 <sli>RTRIM</sli>
 <sli>SCHEMA</sli>
 <sli>SCROLL</sli>



Mime
View raw message