Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 07 Jan 2005 @ 16:16:18 GMT


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


Subj:   Re: "NOT LIKE ANY"
 
From:   Michael Larkins

Hi Fred:

Actually you have fallen into a very common trap when going from equal to not equal.

You are not excluding any rows because ANY implies an "OR" on the comparisons. In other words, "local" is not equal to '%central%' and 'central' is not equal to '%local%' and 'main' is not equal to either of these. Therefore, all rows come back except any that contain a null in format_description. This is based on quanitiers of EQ ANY being the same as IN and NOT EQ ALL being the same as NOT IN.

The simple fix to this should be to use:

     where upper(format_description)
           not like all ('%LOCAL%','%CENTRAL%') or format_description is null;

The null comparison also returns any with null if this is a possibility and you want to see them.


Hope this helps.

Michael Larkins
Certified Teradata Master
Certified Teradata SQL Instructor



     
  <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: 27 Dec 2016