Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 19 Jul 2005 @ 09:24:01 GMT


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


Subj:   Re: SQL Error: expecting something between ( and the select word
 
From:   Anomy Anom

<-- Anonymously Posted: Monday, July 18, 2005 20:03 -->

The subquery with addmonths looks strange. Not sure how it would behave with your data. But, the syntax error you are getting here is because of the subqueries in the between clause. You can rewrite the query as below, replacing the between clause.

     select  x
            ,count(x)

     from     x

     where date >= ( Select Max(rec_date) from y) and
          date <= ( Select add_months(Max(rec_date + 1), -3) - 1 from y)
     group by 1
     order by 1;

 
 
 
 


     
  <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