Sybase searches when you know part of the data |
|
A wildcard search is what you want when you know some of the data you are looking for and you know which column and table it is in. A wildcard is a character that matches any character, or any string of characters.
At the end of each command press the space-bar or press enter before continuing the next step.
select
phone, address
from
where
like
"
John%
If you are looking for John Johnson, whose last name might be spelled
Johnsen, you would type
John Johns_n
Wildcard characters can return all kinds of unsuspected results.
John% would also return Johnathan, Johnnsonn, and
Johnhilda James.
"
go
If there is a value that matches your search, you see the results from your search and
The number may be 2 or 3, or larger if your search matches more than one row.(1 row affected)
For example, to find everyone whose name starts with John in a table called rolodex and return all the columns, type
select * from rolodex where name like John%
go