Re: select strings with '_' in it

2003-08-19 Thread Scott Lamb
Tanel Poder wrote:

Hi!
 
I think translate is overkill here.
 
Use:
 
select col from tab where col like 'v\_lan' escape '\';
vs

> Select col1 from table
> where translate(col1,'_','#') like 'v#lan%'
> /
Not only is the escape method cleaner, it's much more efficient. Unless 
you have an index on translate(col1,'_','#') (unlikely), that query will 
always result in a sequential scan. Ugh.

--
Please see the official ORACLE-L FAQ: http://www.orafaq.net
--
Author: Scott Lamb
 INET: [EMAIL PROTECTED]
Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).


Re: select strings with '_' in it

2003-08-19 Thread Tanel Poder
Title: RE: select strings with '_' in it



Hi!
 
I think translate is overkill here.
 
Use:
 
select col from tab where col like 'v\_lan' escape 
'\';
 
Tanel.

  - Original Message - 
  From: 
  Martin, 
  Alan (Contractor) (DLIS) 
  To: Multiple recipients of list ORACLE-L 
  
  Sent: Wednesday, August 20, 2003 1:39 
  AM
  Subject: RE: select strings with '_' in 
  it
  
  Remember, '_' matches any 1 character, so change what you're 
  looking for. Try: Select col1 
  from table where translate(col1,'_','#') like 
  'v#lan%' / 
  Regards, Alan Martin Defense Logistics Info Service Battle Creek, 
  MI 
  -Original Message- From: Benny 
  Pei [mailto:[EMAIL PROTECTED]] 
  Sent: Tuesday, August 19, 2003 6:19 PM 
  To: Multiple recipients of list ORACLE-L Subject: select strings with '_' in it 
  Hello, 
  I have this data 'v_lan' and also 'vclan'. I would 
  like to select 'v_lan' but not 'vclan'. Is it possible 
  to do that? 
  I tried set escape on select col1 from table where col1 like 'v\_lan' / 
  but it doesn't work. 
  thank you, 
  benny 
  __ Do 
  you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web 
  site design software http://sitebuilder.yahoo.com -- 
  Please see the official ORACLE-L FAQ: http://www.orafaq.net 
  -- Author: Benny Pei   INET: [EMAIL PROTECTED] 
  Fat City Network Services    -- 858-538-5051 http://www.fatcity.com 
  San Diego, 
  California    -- Mailing list and web 
  hosting services - 
  To REMOVE yourself from this mailing list, send an E-Mail 
  message to: [EMAIL PROTECTED] (note EXACT spelling 
  of 'ListGuru') and in the message BODY, include a line containing: UNSUB 
  ORACLE-L (or the name of mailing list you want to be removed from).  You 
  may also send the HELP command for other information (like 
  subscribing).


RE: select strings with '_' in it

2003-08-19 Thread Martin, Alan (Contractor) (DLIS)
Title: RE: select strings with '_' in it





Remember, '_' matches any 1 character, so change what you're looking for.
Try:
Select col1 from table
where translate(col1,'_','#') like 'v#lan%'
/


Regards,
Alan Martin
Defense Logistics Info Service
Battle Creek, MI


-Original Message-
From: Benny Pei [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, August 19, 2003 6:19 PM
To: Multiple recipients of list ORACLE-L
Subject: select strings with '_' in it



Hello,


I have this data 'v_lan' and also 'vclan'. I would
like to select 'v_lan' but not 'vclan'. Is it possible
to do that?


I tried 
set escape on
select col1 from table where col1 like 'v\_lan'
/


but it doesn't work.



thank you,


benny


__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Benny Pei
  INET: [EMAIL PROTECTED]


Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California    -- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from).  You may also send the HELP command for other information (like subscribing).




RE: select strings with '_' in it

2003-08-19 Thread Jacques Kilchoer
select col1 from table where col1 like 'v\_lan' escape '\' ;

> -Original Message-
> From: Benny Pei [mailto:[EMAIL PROTECTED]
> 
> I have this data 'v_lan' and also 'vclan'. I would
> like to select 'v_lan' but not 'vclan'. Is it possible
> to do that?
> 
> I tried 
> set escape on
> select col1 from table where col1 like 'v\_lan'
> /
> 
> but it doesn't work.
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Jacques Kilchoer
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).