Hi Kris,
You can do that using the following query :

select ship_id,ship_name from shipment where ship_name in
(select ship_name from test where instr(ship_name,ship_id)>1);

Best Regards
Jai




"Krishnaswamy, Ranganath" <[EMAIL PROTECTED]>
Sent by: [EMAIL PROTECTED]

12/17/02 04:08 PM
Please respond to ORACLE-L

       
        To:        Multiple recipients of list ORACLE-L <[EMAIL PROTECTED]>
        cc:        
        Subject:        Dynamic select query



Hi all,

                I have a table by name shipment with two columns say ship_id and
ship_name and data as follows:

SHIP_ID                 SHIP_NAME
-------------                  -------------------
ABC                                   1ABCLMN
XYZ                                   23XYZ1112
ABB                                   123LM

                I want to select all the columns in shipment table which has ship_id
as string in the ship_name column.  For example, ship_id 'ABC' is present in
'1ABCLMN'.  So that record should be selected.  The ship_id string may start
from any position and end at any position in ship_name column.  So I cannot
use the substr function in this case.  How do I write the select clause for
this requirement?

                Any help in this regard is very much appreciated.

Thanks and Regards,

Ranganath
WARNING: The information in this message is confidential and may be legally
privileged. It is intended solely for the addressee.  Access to this message
by anyone else is unauthorised.  If you are not the intended recipient, any
disclosure, copying, or distribution of the message, or any action or
omission taken by you in reliance on it, is prohibited and may be unlawful.
Please immediately contact the sender if you have received this message in
error. Thank you.
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Krishnaswamy, Ranganath
 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).



Reply via email to