Home Page for the TeradataForum

Archives of the TeradataForum

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

  <Prev Next>   <<First <Prev

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


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.


Robert Diehl
Travelocity Data Warehouse DBA

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