Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Retrieving 4 records as 1 record
Try something like this:
create view orderview (order#, placed, received, answered, completed)
as
select p.order#, p.orderstatus, r.orderstatus, a.orderstatus, c.orderstatus
from orderstatus p, orderstatus r, orderstatus a, orderstatus c where
p.order_followup# = 101 and p.order# = r.order#(+) and r.order_followup#(+) = 102 and p.order# = a.order#(+) and a.order_followup#(+) = 103 and p.order# = c.order#(+) and c.order_followup#(+) = 104
I assume all orders are placed (order_followup 101).
There are several other solutions also.
D A
Abeeda_Mohammed_at_xn.xerox.com wrote:
> Hello,
>
> I have a table with the following fields :
>
> Order_no,
> Order_followup_no,
> orderstatus
>
> If the records in the table are
>
> Order# Order_followup# Orderstatus
> 1 101 PLACED
> 1 102 RECIVED
> 1 103 ANSWERED
> 1 104 COMPLETE
> 2 101 PLACED
> 2 102 RECEIVED
> 2 103 ANSWERED
> 2 104 COMPLETE
>
> I want to create a view which displays
>
> 1 PLACED RECEIVED ANSWERED COMPLETE
> 2 PLACED RECEIVED ANSWERED COMPLETE
>
> How do I do this?
>
> Thank you,
>
> Abeeda
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/ Now offering spam-free web-based newsreading
Received on Wed May 27 1998 - 00:47:07 CDT