List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:May 11 2002 10:41pm
Subject:Re: SQL Pattern Matching
View as plain text  
At 13:43 -0700 5/11/02, impala wrote:
>Thanks for answering
>"search character by character" 11 May 2002
>
>Making use of a HTML textfield which sends text to
>variable 'varLastName'.
>How do I concatenate the variable part('varLastName')
>with
>the % part is it something like:
>
>SELECT LASTNAME, FIRSTNAME,
>DEPARTMENT FROM EMPLOYEES WHERE LASTNAME LIKE
>'varLastName'&%
>OR is it something like 'varLastName%' ??

Depends on your scripting language, and you haven't
mentioned what that is.

>
>Previous Answer:
>Use a SQL pattern and the LIKE operator.  For example
>"C%"
>matches any value beginning with "C".  "Wil%" matches
>any value beginning with "Wil".
>
>Some of the other responses you've gotten indicate
>that
>you should use "%var%", but that will match values
>that
>contain var anywhere, not just at the beginning.

Thread
SQL Pattern Matchingimpala11 May
  • Re: SQL Pattern MatchingPaul DuBois12 May
    • SQL Pattern Matching & Scriptimpala12 May