Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 18 Jan 2001 @ 17:53:00 GMT


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


Subj:   Re: Unique Value Algorithm
 
From:   Frank Martinez

How about we use the machine, guys?

     /*****
      * A more generic, Teradata-type solution!
      *****/
     SELECT COUNT(*)
       FROM DrugPriceGroup;

     SELECT COUNT(DISTINCT HASHROW(DrugCode, BeginDate, EndDate, EAC, DATE))
       FROM DrugPriceGroup;

The only problem with this is that we generate a BYTE variable, which can't be CAST into an Integer. But if the solution that Sudarsan suggests works, then this would work as well. Notice that I left off the time, because SQL is a "set" language, so the time isn't set for each individual record, but as a set that is "joined" to the other data set from the table. In other words, the time won't be different for any of the resulting values.

Or maybe I'm overdoing it?

iv

Frank C. Martinez IV



     
  <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