Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Mon, 10 Jan 2005 @ 09:55:46 GMT


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


Subj:   Re: "NOT LIKE ANY"
 
From:   Fred Easey

  What has fixed the problem... What did you end up doing?  


The issue was as you said the incorrect use of the "ANY" operator eg to select records which have the string "LOCAL" or "CENTRAL" in the specified text column I use this syntax (which works fine):

     LIKE ANY ('%LOCAL'%,'%CENTRAL%')

I needed to reverse this this (eg exclude records which have the string "LOCAL" or "CENTRAL"), so I added a NOT operator:

     NOT LIKE ANY ('%LOCAL'%,'%CENTRAL%')

As you pointed out, this doesn't work, as it translates as "Exclude records that have the string "LOCAL" *and* "CENTRAL". To fix this I took your suggestion and changed the ANY to an ALL:

     NOT LIKE ALL ('%LOCAL'%,'%CENTRAL%')

...this generated the required effect of excluding records that had the string "LOCAL" *or* "CENTRAL".

Seems so obvious now.


Thanks for the help,

Fred



     
  <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