Need help... problem with % Symbol

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • write2ashokkumar
    New Member
    • Feb 2007
    • 39

    Need help... problem with % Symbol

    hi....

    i have a table xyz.

    id --------- desc
    1 ---------- EE%DA
    2 ---------- A#D


    In the table value... i have the % symbole in the value itself, but

    i want to search like this ....

    select * from xyz where desc like '%E%D%';

    When i run the above query.. i got the empty result set... but i have the value in the table xyz. What is the problem in that query? Can u any one solve this problem? How to write the query to search like that....


    Thanks & Regards,
    S.Ashokkumar.
  • vpmurdan
    New Member
    • Feb 2007
    • 25

    #2
    Hi.
    Can you have a field named 'DESC'. DESC is a reserved word and normally can not be used as a field name.

    Otherwise I tried your query with field name 'DESC1' and it works.

    Verify whether you do have any record in your table.

    Prakash

    Comment

    • write2ashokkumar
      New Member
      • Feb 2007
      • 39

      #3
      Originally posted by vpmurdan
      Hi.
      Can you have a field named 'DESC'. DESC is a reserved word and normally can not be used as a field name.

      Otherwise I tried your query with field name 'DESC1' and it works.

      Verify whether you do have any record in your table.

      Prakash


      hi...

      For example... i gave the field name as desc... u assume desc -> describe, My problem is not the keyword, my problem is using the % symble in like clause... i got the empty record set...

      Regards,
      S.Ashokkumar.

      Comment

      • vpmurdan
        New Member
        • Feb 2007
        • 25

        #4
        Hi. I told you, I did try your query and it works! (using desc1 instead of desc). does your table have any record?
        Last edited by vpmurdan; Feb 27 '07, 11:58 AM. Reason: record instead of table

        Comment

        • ronverdonk
          Recognized Expert Specialist
          • Jul 2006
          • 4259

          #5
          To test for literal instances of a wildcard character (like %), precede it by the escape character. If you do not specify the ESCAPE character, ‘\’ is assumed.

          Ronald :cool:

          Comment

          Working...