| Archives of the TeradataForumMessage Posted: Tue, 02 Oct 2007 @ 20:08:25 GMT
 
 
  
| Subj: |  | Re: Float data type compressions |  |  |  | From: |  | Babak Teymouri |  
 Find out the most 255 used values and compress them. This query may help you to find out which values are in the most 255 list. ( I'm using this on a V2R6.2 system ) 
     Select columnname
     , count(*) as nbvals
     , sum( nbvals) over(order by nbvals desc rows between unbounded
     preceding and current row) /
              ( Sum(nbvals) over() (float) )  as cumulative_distribution
     >From tablename
     Group by columnname
     Qualify rank() over( order by nbvals desc )  <= 255
 Cheers, Babak 
 
 |