![]() |
|
Archives of the TeradataForumMessage Posted: Wed, 14 Apr 1999 @ 11:51:39 GMT
Does anybody know if Teradata supports the use of automatically numbered columns, I know SQL Anywhere uses INT IDENTITY and Informix uses SERIAL(1). e.g. for SQL Anywhere:
CREATE TABLE sm.ISMTMP (CLIENTNUM INTEGER, ROWSEQNUM INT IDENTITY)
Each time you insert into the above table the value of ROWSEQNUM for the new row equals the previous row plus one. I also have some further interesting SQL below, is there a Teradata equivalent for the Number(*) function.
CREATE TABLE sm.ISMTMP (CLIENTNUM INTEGER, RANNUM FLOAT)
/* Generate Random Sequence */
INSERT INTO sm.ISMTMP (CLIENTNUM, RANNUM) SELECT A.CLIENTNUM,
Number(*)/215.0 FROM sm.DBA257QV A
/* Generate Random Sequence (Modulo 100)*/
INSERT INTO sm.ISMTMP (CLIENTNUM, RANNUM) SELECT A.CLIENTNUM,
mod(Number(*),100) / 100.0 FROM sm.DBA257QV A
Any help appreciated. Thankyou, Dean Taplin
| ||||||||||||||||||||||||||||||||||||||||||||||||
| | ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||
| Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
| Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||