|
Archives of the TeradataForumMessage Posted: Fri, 31 Oct 2003 @ 17:50:23 GMT
Without knowing what your query looks like here a some examples. 1) Select a.rowid from table1 a; Gives you the internal (and unique) rowid for table "A". 2) select csum(1,a couple of fields) from table1 a inner table2 b on a.a = b.a; Gives a sequential # for every row in a result set. Csum works by ordering the result set according to an order list (denoted by "a couple of fields") and then computes a rolling sum according to the first argument (in this case the number "1"). The end result is that every row is assigned a unique number. 3) You can also use the sum window function instead of csum. Good luck.
| ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||