Next
/
Previous
/ Index
/ TCC Help System
/ Publications
/ Site map
/ NM Tech homepage
Sybase searches for multiple columns
|
|
If you want to search for items in multiple columns (for
instance, all the Johns in Seattle in a rolodex) this is the way
to do it.
At the end of each command press the space-bar or press enter before continuing the next step.
- Type
select
- Type the name of the columns you displayed after the search.
Separate each column name with a comma.
For instance, if you are searching for John Jones and you want to know his
phone number and his address, so you would type
phone, address
- If you want every column to be returned, type an asterisk.
- Type
from
- Type the name of the table you are searching.
- Type
where
- Type the name of the column you are searching.
- Type
like
- Type
"
- Type the word(s) for the first item you are searching for,
including any wildcards you need (see
`Sybase searches when you know part of the data' for more about wildcards).
- Type
"
- Type
and
- Type the name of the column you are searching.
- Type
like
- Type
"
- Type the word(s) you the first item you are searching for,
including any wildcards you need.
- Type
"
- If you need to add any more columns, repeat the "and
column_name like data" group.
- Type
go
- Press Enter.
If there is a value that matches your search, you see the
results from your search and
(1 row affected)
The number may be 2 or 3, or larger if your search matches more
than one row.
For example, to find all the Johns in Seattle in a table
called rolodex and return all the columns, type
select * from rolodex where name like John%
and city=Seattle go
Next: Sybase: computing values from search results
See also: Searching Sybase databases
Previous: Sybase searches when you know part of the data
Site map
Index:
Keyword index
to help pages
Help:
New Mexico Tech Computer Center: Help System
TCC Publications
Home:
About New Mexico Tech
Maintained by John Shipman, john@nmt.edu;
original by Steve Anderson
Last updated: 1997/06/25 20:21:06 UT
URL: http://www.nmt.edu/tcc/help/db/sybase/search_mult_cols.html