Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Sun, 17 Jul 2005 @ 10:26:52 GMT


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


Subj:   Re: SQL Error: expecting something between ( and the select word
 
From:   Matthew Winter

Hi,

I would write the query something like

     SELECT
          X
        , COUNT(*)
     FROM X
        INNER JOIN (SELECT
                        MAX(REC_DATE) AS MAX_REC_DATE
                    FROM Y) AS dt1
          ON DATE BETWEEN dt1.MAX_REC_DATE
                      AND ADD_MONTHS(dt1.MAX_REC_DATE, -3)
     GROUP BY 1
     ORDER BY 1

Hope this helps.

Matthew Winter



     
  <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