Home Page for the TeradataForum

Archives of the TeradataForum

Message Posted: Thu, 30 Jun 2005 @ 05:13:52 GMT

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

Subj:   Re: How to delete selectively
From:   Dieter Noeth

Glenn David McCall wrote:

  If you truly want to delete 50 rows at random, you will need to create another table with the key values of the 50 randomly selected rows.  

Or simply use a subquery, but this results in a 3706 "sample not allowed in subqueries".

But it'a allowed within a derived table :-)

     Delete from some_table
     Where (col1, col2, col3) in
       (select *
          (Select col1, col2, col3
            From some_table
            Sample 50) dt


  <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