Home Page for the TeradataForum

Archives of the TeradataForum

Message Posted: Fri, 16 Feb 2001 @ 17:42:35 GMT

  <Prev Next>   <<First <Prev

Subj:   Re: Subquery Conundrum
From:   David Hough


I opened an incident on this issue 4/99 and learned that it's behaving as designed. The source of the trouble is that correlated subqueries need to be able reference names from the surrounding query. The ANSI standard apparently does not require that such names be fully qualified, so NCR has not required it either. If you fully qualify your names, or put aliases on all your tables & use them to reference columns you will get the expected error message. For example:

     > select * from mbtemp1
     > where
     > c1 not in
                 (select mbtemp2.c1 from mbtemp2)


     > select * from mbtemp1 a
     > where
             a.c1 not in
                 (select b.c1 from mbtemp2 b)

For reference: REC9BKD4G. The incident also references RFC DR42470, but I'm not sure why (I can't see DRs through support link).

Hope this helps.

/dave 'doc' hough

  <Prev Next>   <<First <Prev
  Top Home Privacy Feedback  
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023