Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 14 Nov 2012 @ 12:37:41 GMT


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


Subj:   Re: What is the use of LIKE operator for char fields
 
From:   Diehl, Robert

Jeeva,

You can think of it this way

Filter on CHAR field always pads your filter to make it the length on comparison. So Request_Id = 'jeeva' becomes Request_Id = 'jeeva    ' The like does not remove the trailing spaces in a CHAR. Thus '%a' does not match 'a    ' IF you want where 'a' is anywhere in the string to work use '%a%' I have not compared Trim(col) like '%a' to '%a%', but I susoect '%a%' will be more efficient.

Please test and post your results.


Thanks,

Robert Diehl
Travelocity Data Warehouse DBA



     
  <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