Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 10 Mar 2005 @ 17:34:50 GMT


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


Subj:   Re: Restrict number of Rows Affected
 
From:   David Wellman

No, that is not possible with Teradata SQL (no doubt purists would argue that the SQL Server 'solution' breaks the SQL rules which basically says "this function must be performed agains ALL rows that meet the selection criteria" - but I'm not going to get into any 'religious' debates about that).

If you need to delete a portion of rows then you could take a number of different approaches, each of which will no doubt have pro's and cons for your site:

- use something like Multiload to delete the rows a chunk at a time. This would require building multiple data files, each with a different set of primary index values.

- code multiple DELETEs as separate transactions. In each DELETE statement add the following to the WHERE clause

          AND SALEDATE MOD 10 = n  (where n is a value 0 - 9)

Each DELETE will now remove @10% of the full set of data rows (and before anyone points it out I have only said approx 10%, the actual amounts will depend on the variation of the number of rows with each SaleDate value). If dividing the set of rows in 10 chunks is not enough then use the same approach to divide into 20, or 100 or 'whatever'.


Cheers,

Dave



     
  <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