Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 14 Apr 1999 @ 11:51:39 GMT


     
  <Prev Next>  
<<First
<Prev
Next> Last>>  


Subj:   Numeric functions in Teradata
 
From:   Dean Taplin

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
Developer
Intrinsic Ltd
United Kingdom



     
  <Prev Next>  
<<First
<Prev
Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 27 Dec 2016