Reputation: 1819
I have a table in google bigquery of the form:
id value
798 <val>
879 <val>
774 <val>
23 <val>
And I want to build a table of the form:
id value int_var
798 <val> 1
879 <val> 2
774 <val> 3
23 <val> 4
where the variable int_var is a simple incremental variable. Can someone help me?
Upvotes: 2
Views: 5503
Reputation: 172994
SELECT
id,
value,
ROW_NUMBER() OVER() AS int_var
FROM YourTable
Upvotes: 4