ADSM-L

Re: syntax for using "like" in select statement?

2002-08-13 13:50:21
Subject: Re: syntax for using "like" in select statement?
From: Andy Raibeck <storman AT US.IBM DOT COM>
To: ADSM-L AT VM.MARIST DOT EDU
Date: Tue, 13 Aug 2002 13:50:52 -0400
For "somevalue", use a partially qualified string surrounded by single
quotes. Pattern matching characters include '%', which means "0 or more
characters", and '_', which means exactly one character. Examples:

Match all strings beginning with ABC:

   like 'ABC%'

Match all strings ending in XYZ:

   like '%XYZ'

Match all strings containing LMN:

   like '%LMN%'

Match all strings beginning with ABC and ending with Z:

   like 'ABC%Z'

Match all strings beginning with ABC that are exactly 4 characters long:

   like 'ABC_'

etc.

Note that SQL string comparisons are case sensitive. For example, if you
want to find all node names that begin with MICHELLE, then you need to
use:

   select node_name from nodes where node_name like 'MICHELLE%'

Since in TSM, all node names are in upper case. As a general rule, most of
the TSM strings are upper case except for things like file names, file
system names, and contact information.

Regards,

Andy

Andy Raibeck
IBM Software Group
Tivoli Storage Manager Client Development
Internal Notes e-mail: Andrew Raibeck/Tucson/IBM@IBMUS
Internet e-mail: storman AT us.eyebm DOT com (change eye to i to reply)

The only dumb question is the one that goes unasked.
The command line is your friend.
"Good enough" is the enemy of excellence.




Michelle DeVault <adsmigmo AT YAHOO DOT COM>
Sent by: "ADSM: Dist Stor Manager" <ADSM-L AT VM.MARIST DOT EDU>
08/13/2002 10:25
Please respond to "ADSM: Dist Stor Manager"


        To:     ADSM-L AT VM.MARIST DOT EDU
        cc:
        Subject:        syntax for using "like" in select statement?



I'm sure this has been answered before, I just can't
find it in the archived on adsm.org.

How can I use a "like" in a select statement?  I don't
know the value exactly, just know a portion of it.

ex.
select * from sometable where somecolumn like somevalue

__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com

<Prev in Thread] Current Thread [Next in Thread>