Archives of the TeradataForum
Message Posted: Mon, 09 Oct 2000 @ 16:52:44 GMT
Many people have used RANK as a means of generating sequential numbers for rows in an answer set. It's fine if you can uniquely identify each row (and to be honest most of the time you can). But on the off-chance that you can't, try using the following sql that I came across whilst teaching a course recently;
SELECT col-1,col-2,..., CSUM(1,1) FROM table ....
This will generate sequential id's for each row in the answer set, regardless of duplicate data values.
|Copyright 2016 - All Rights Reserved|
|Last Modified: 28 Jun 2020|