Like '&'

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Saii
    Recognized Expert New Member
    • Apr 2007
    • 145

    Like '&'

    how do we get data that contains '&'

    Example:

    select * from table
    where column like 'a&b%'

    This assumes &b as subsitution and asks for value. how to escape the &?
  • puneetgupta03
    New Member
    • Apr 2007
    • 5

    #2
    Hi,

    Try this

    set esc ' \'

    select * from emp where ename like 'a\&b%' ;

    Comment

    • debasisdas
      Recognized Expert Expert
      • Dec 2006
      • 8119

      #3
      Since "&" is the define character

      Anything that follows & is considered as a variable

      to avoid this try


      set define off


      then execute the query.

      Comment

      Working...