Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
dev:sql:functions:current_row [2010/07/09 16:57]
tdo
dev:sql:functions:current_row [2016/06/28 22:38] (current)
Line 1: Line 1:
 {{page>:​top_add&​nofooter&​noeditbtn}} {{page>:​top_add&​nofooter&​noeditbtn}}
-<html><div align="​center"><​span style="​color:red">​DRAFT</​span></​div></​html>​+{{page>:sql_bar&​nofooter&​noeditbtn}} 
 ====== Omnidex SQL Function: $CURRENT_ROW ====== ====== Omnidex SQL Function: $CURRENT_ROW ======
-{{page>:​sql_bar&​nofooter&​noeditbtn}} 
 ===== Description ===== ===== Description =====
-Returns ​the current row as an ascending ​number from starting with 1.+The $CURRENT_ROW function return ​the current row number ​for the result set.  The first row returned ​from a SELECT statement is given a value of 1, and each successive row is incremented by one.  This is done as the last step of a statement, and so $CURRENT_ROW can only be used as a select-item. ​ It cannot be used in the WHERE, GROUP BY, ORDER BY or HAVING clauses 
  
-This number ​is assigned after all other clauses are processed.+The $CURRENT_ROW should not be confused with the $ROWID. ​ The $ROWID comes from the underlying database, where $CURRENT_ROW ​is simply the current row number of the result set.
  
-This function ​may only be used as a select-item. It may NOT be used in a WHERE , GROUP BY, ORDER BY, or HAVING clause.+This function ​returns an INTEGER datatype 
  
-The return data type is INTEGER.+===== Syntax ===== 
 +$CURRENT_ROW
  
-===== Syntax ===== +===== Examples ​===== 
-  $CURRENT_ROW +==== Example 1: Column ​====
-===== Example ​===== +
-==== Example 1 ====+
 <​code>​ <​code>​
-select $current_row, ​company ​from customers+select $current_row, ​name from individuals;​
  
-$CURRENT_ROW ​  ​COMPANY +$CURRENT_R ​ NAME 
------------- ​  ​-------------------------------------+---------- ​ -------------------------------------------------- 
 +         ​1 ​ MS. MARY LEWIS 
 +         ​2 ​ MRS. ALICE R TOLLIVER 
 +         ​3 ​ MR. SIDNEY K TOLLIVER 
 +         ​4 ​ MRS. JENNIFER J HOPKINS 
 +         ​5 ​ MR. CHARLIE HOPKINS 
 +         ​6 ​ MS. KIMBERLY BLUE 
 +         ​7 ​ KATHLEEN TUCKER</​code>​
  
-1  Dynamic Information Systems Corporation+====== Additional Resources ======
  
-2  The Bovaird Supply Company+See also: 
 +{{page>​dev:​sql:​functions:​see_also_variables&​nofooter&​noeditbtn&​noheader}}
  
-3  Graham Container Companies+{{page>:​bottom_add&​nofooter&​noeditbtn}}
  
-... 
-</​code>​ 
-  
- 
- 
- 
-{{page>:​bottom_add&​nofooter&​noeditbtn}} 
 
Back to top
dev/sql/functions/current_row.1278694648.txt.gz · Last modified: 2016/06/28 22:38 (external edit)