Results 1 to 3 of 3

Thread: Escape sequence

  1. #1
    Join Date
    Aug 2004

    Unanswered: Escape sequence

    I have a question with this query -
    SELECT * FROM table1 WHERE column1 = 'T_C_%';

    This query returns rows where column1 = "T_Care", "T_CRP" etc etc, whereas I was expecting only rows where column1 = "T_C_Tail", "T_C_Head"

    However, when I use an escape character(/), the results are more in the lines of the expected results.

    Can somebody explain this?
    cheers/- Pradeep

  2. #2
    Join Date
    Feb 2004
    In front of the computer
    Provided Answers: 54
    In a LIKE expression, any underscore (_) matches any one character, and any percent sign (%) matches any group of characters. You can also use brackets ([]) to define sets of characters.

    See the BOL description of LIKE for more details.


  3. #3
    Join Date
    Aug 2004
    Thanks Pat, really appreciate your quick response.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts