|
|
Archives of the TeradataForum
Message Posted: Mon, 29 Oct 2007 @ 19:06:01 GMT
Subj: | | Re: Generate unique id |
|
From: | | Matkar, Ankit |
Hi,
Since you are saying that the Ordered analytical functions are not working....The easiest thing that comes to mind is create a table with four
columns-fd1,fd2,fd3 and a fourth column UNIQUE_ID which can be a IDENTITY column and can be defined as something like
UNIQUE_ID INTEGER GENERATED ALWAYS AS IDENTITY
(START WITH 1
INCREMENT BY 1
MINVALUE 1
MAXVALUE 2147483647
NO CYCLE)
Then you can insert all the unique values for fd1,fd2,fd3 and a null in the UNIQUE_ID column. The Unique_ID can thus be automatically
generated for each unique combination of fd1,fd2 and fd3. You can then use this unieid by joining fd1,fd2 and fd3 per you need.
This may not be the best method but the first first thing that came to my mind.
| |