This shows you the differences between two versions of the page.
dev:sql:functions:current_row [2010/07/28 22:59] els |
dev:sql:functions:current_row [2016/06/28 22:38] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | {{page>:top_add&nofooter&noeditbtn}} | ||
- | {{page>:sql_bar&nofooter&noeditbtn}} | ||
- | |||
- | ====== Omnidex SQL Function: $CURRENT_ROW ====== | ||
- | ===== Description ===== | ||
- | 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. | ||
- | |||
- | 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 returns an INTEGER datatype. | ||
- | |||
- | ===== Syntax ===== | ||
- | $CURRENT_ROW | ||
- | |||
- | ===== Examples ===== | ||
- | ==== Example 1: Column ==== | ||
- | <code> | ||
- | > select $current_row, name from individuals; | ||
- | |||
- | $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> | ||
- | |||
- | ====== Additional Resources ====== | ||
- | |||
- | See also: | ||
- | {{page>dev:sql:functions:see_also_variables&nofooter&noeditbtn&noheader}} | ||
- | |||
- | {{page>:bottom_add&nofooter&noeditbtn}} | ||