Return-Path: <root@fatcity.cts.com>
Received: from ensim.rackshack.net (root@localhost)
 by orafaq.net (8.11.6/8.11.6) with ESMTP id h0TGQSL00868
 for <oracle-l@orafaq.net>; Wed, 29 Jan 2003 10:26:28 -0600
X-ClientAddr: 209.68.248.164
Received: from newsfeed.cts.com (newsfeed.cts.com [209.68.248.164])
 by ensim.rackshack.net (8.11.6/8.11.6) with ESMTP id h0TGQSm00862
 for <oracle-l@orafaq.net>; Wed, 29 Jan 2003 10:26:28 -0600
Received: from fatcity.UUCP (uucp@localhost)
 by newsfeed.cts.com (8.9.3/8.9.3) with UUCP id FAA65221;
 Wed, 29 Jan 2003 05:10:04 -0800 (PST)
Received: by fatcity.com (26-Feb-2001/v1.0g-b72/bab) via UUCP id 0053D12A; Wed, 29 Jan 2003 04:29:14 -0800
Message-ID: <F001.0053D12A.20030129042914@fatcity.com>
Date: Wed, 29 Jan 2003 04:29:14 -0800
To: Multiple recipients of list ORACLE-L <ORACLE-L@fatcity.com>
X-Comment: Oracle RDBMS Community Forum
X-Sender: "Krishnaswamy, Ranganath" <Ranganath.Krishnaswamy@blr.hpsglobal.com>
Sender: root@fatcity.com
Reply-To: ORACLE-L@fatcity.com
Errors-To: ML-ERRORS@fatcity.com
From: "Krishnaswamy, Ranganath" <Ranganath.Krishnaswamy@blr.hpsglobal.com>
Subject: Return the first row only
Organization: Fat City Network Services, San Diego, California
X-ListServer: v1.0g, build 72; ListGuru (c) 1996-2001 Bruce A. Bergman
Precedence: bulk
Mime-Version: 1.0
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi List,

I have the below query which returns 13 records.  In this I want to display
only the 1st row.  Is it possible to do this through rownum or any other
function or pseudo column?  If so, please let me know the same.  Any help in
this regard is very much appreciated.

select 'shipment' table_name,ce.display_name,st.timestamp, sequence 
from shipment_timestamp st, customer_event ce, xm_field xm 
where shipment_id = 10402344721477 
and ce.CUSTOMER_MOT_ID = 1040130035205
and xm.field_id = ce.field_id
and st.event_id = xm.event_id
union
select 'container' table_name,ce.display_name,sct.timestamp, sequence  
from shipment_container_timestamp sct, customer_event ce, xm_field xm 
where shipment_id = 10402344721477 
and ce.CUSTOMER_MOT_ID = 1040130035205
and xm.field_id = ce.field_id
and sct.event_id = xm.event_id
union
select 'order' table_name,ce.display_name,ot.timestamp, sequence  
from order_timestamp ot, shipment_order so,customer_event ce, xm_field xm 
where so.shipment_id = 10402344721477 
and so.order_id = 2
and ot.shipment_order_id = so.shipment_order_id  
and ce.CUSTOMER_MOT_ID = 1040130035205
and xm.field_id = ce.field_id
and ot.event_id = xm.event_id order by sequence desc 

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.net
-- 
Author: Krishnaswamy, Ranganath
  INET: Ranganath.Krishnaswamy@blr.hpsglobal.com

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: ListGuru@fatcity.com (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).

