Select * from 
(
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
nd 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
nion
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 
) 
where rownum < 2

don't expect it to be fast ;-)

> Frank <              


>Von: Krishnaswamy, Ranganath
>[mailto:[EMAIL PROTECTED]]
>Gesendet am: Mittwoch, 29. Januar 2003 13:29
>An: Multiple recipients of list ORACLE-L
>Betreff: Return the first row only
>
>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 

.....

>from shipment_container_timestamp sct, customer_event ce, xm_field xm 
>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

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Foelz.Frank
  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