Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 16 Jul 2004 @ 07:19:26 GMT


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


Subj:   Re: Comparing output from two SQLs
 
From:   Victor Sokovin

  I assume that you want to know if the two produce the same result.  


          Select count(*)
          From
          (
          ..First SQL goes here...

          MINUS

          ..second SQL goes here....

          )
          ;
  If the datasets are the same, you will get 0. Actually, if all the rows from the second record set are found in the first, you will get 0. If it is possible that you will get rows in the first that are not in the second, you would have to run the sql twice by switching the order of the two sql statements.  


  If the columns are different, you will get an error.  



MINUS ALL might be worth considering as well if you want to pick up all distinct rows.


Regards,

Victor



     
  <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