Archives of the TeradataForum
Message Posted: Sat, 24 Jun 2006 @ 10:11:39 GMT
Subj: | | Re: Can't get ROW_NUMBER to Work |
|
From: | | Dieter Noeth |
Rick.Tangri wrote:
| I need to add a counter to this query. I was thinking just to add this line: | |
> ROW_NUMBER() OVER (PARTITION BY E.column1 ORDER BY 2)
| For some reason this doesn't work- I get ones in the new column. | |
The reason is the PARTITION, it restarts the counter for each new column1, so you just have to remove it.
But you'll have to modify the ORDER, too. You can't use a column number here, it's the *value* 2, so it's useless (and will probably skew
spool):
ROW_NUMBER() OVER (ORDER BY Column2)
Dieter
|