Top "Row-number" questions

An index or rank which indicates a row's position in a data-set.

CTE, ROW_NUMBER and ROWCOUNT

I am trying to return a page of data and also row count of all data in one stored procedure …

sql sql-server common-table-expression row-number rowcount
Add numbers to the beginning of every line in a file

How can I add numbers to the beginning of every line in a file? E.g.: This is the text …

bash row-number
How to add row number column in SQL Server 2012

I'm trying to add a new column to an existing table, where the value is the row number/rank. I …

sql sql-server ranking row-number ranking-functions
How To Project a Line Number Into Linq Query Results

How can I project the row number onto the linq query result set. Instead of say: field1, field2, field3 field1, …

linq row-number
SSRS Row Group + Column Group = RowNumber Issue

I'm back with another SSRS question :-) I'm dealing with survey data. I have a procedure that's returning an organization's …

reporting-services row-number
How do I get a SQL row_number equivalent for a Spark RDD?

I need to generate a full list of row_numbers for a data table with many columns. In SQL, this …

sql apache-spark row-number rdd
Multiple columns in OVER ORDER BY

Is there a way to specify multiple columns in the OVER ORDER BY clause? SELECT ROW_NUMBER() OVER(ORDER BY (…

sql sql-server sql-order-by row-number
Add a sequential number on create / insert - Teradata

In oracle we would use rownum on the select as we created this table. Now in teradata, I can't seem …

sql teradata row-number
How to add ROW_NUMBER() in a view?

In PostgreSQL 8.4 I want to create a view from 3 tables with id. So I want to have this structure in …

sql postgresql sql-view row-number
Getting the First and Last Row Using ROW_NUMBER and PARTITION BY

Sample Input Name | Value | Timestamp -----|-------|----------------- One | 1 | 2016-01-01 02:00 Two | 3 | 2016-01-01 03:00 One | 2 | 2016-01-02 02:00 Two | 4 | 2016-01-03 04:00 …

sql sql-server tsql window-functions row-number