Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 24 Jan 2008 @ 10:32:45 GMT


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


Subj:   Confusing of the 'NOT LIKE' logic
 
From:   Weng, Silei

Hi Everyone,

I get confused by the logic of the 'NOT LIKE'. The case is that I have a table with 413644 records and there is a column in it called 'URL_TXT'.

So what I did is:

First, I ran the following query:

     sel count(*)   from Tbl_A
     where url_txt   like 'http://%'
     OR
     url_txt   like 'https://%'

I got the row count 240624.

And then, I ran another query:

     sel count(*)   from Tbl_A
     where url_txt  NOT  like 'http://%'
     AND
     url_txt  NOT like 'https://%'

And I only got the row count 200!

It really confused me. Shouldn't the result be 413644 - 240624 = 173020 rows?

I am in a V2R6 system and I've found nothing from the manual of 'LIKE'.

Could anyone explain this?

Really appreciate your helps!


Thanks,

Ray



     
  <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