At 2:53 -0700 5/11/02, impala wrote:
>I would like a person to search for a surname. If for
>example you have the surnames "Clark", "Williams" and
>"Wilcox" in the database.
>e.g. If the person search just for "Wil" the surnames
>"Williams" and "Wilcox" must be displayed. If the
>person search just for "C" the surname Clark must be
>I have something like: SELECT LASTNAME, FIRSTNAME,
>DEPARTMENT FROM EMPLOYEES WHERE LASTNAME LIKE
>But then you have to enter the whole word. If you
>search for "Clark" you need to type in the whole word
>Just by typing part of the word ,how can I make a
>search in databse possible by using something like
>SELECT in SQL?
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.