Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 04 Mar 2005 @ 16:30:47 GMT


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


Subj:   Re: Random function with a column value
 
From:   Dieter Noeth

Jones Brian wrote:

  How can I use a column value with the random function? For example, I have a table with a column named STORE_COUNT which is an integer with values from 1 to 5.  


     RANDOM(1,2000000000) MOD STORE_COUNT + 1 AS MYCOLUMNX

Generic version with arbitrary minval and maxval:

     random(1,2000000000) mod ( maxval - minval + 1) + minval

Dieter



     
  <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: 15 Jun 2023