Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: output

Re: output

From: Daniel Morgan <damorgan_at_x.washington.edu>
Date: Sat, 24 Jan 2004 06:53:00 -0800
Message-ID: <1074955914.67374@yasure>


Marcel wrote:

> Hi,
>
> I'm trying to figure out the following problem.
> I've got 2 tables and 3 columns I wish to combine into one table.
>
> rel_id (table=relation & answer)
> 11
> 22
> 33
> 44
> 55
> ...
>
> question (table=answer)
> q1
> q2
> q3
> q4
> q5
> ....
>
> quantity (table=answer)
> 100
> 100
> 200
> 300
> 400
> ...
>
> The result should look something like this
>
> rel_id q1 q2 q3 q4 q5 ..
> 11 100 100 200 300 100 ...
> 22 100 220 100 400 500 ...
> 33 200 ... 200 100 100 ...
> 44 ... 100 100 200 300 ...
> 55 200 250 230 221 219 ...
> .. ... ... ... ... ... ...
>
> Any help would be appreciated!
> Marcel

Based on what you posted it is impossible. To accomplish the goal the tables would require a referential relationship between the tables. I am going to, for the moment, assume that such exists and that you just didn't think it important to show it and thought we should guess.

Then, of course, there is the matter that this is homework so all you get is a hint ... not the answer ... so here's your hint.

Use DECODE.

-- 
Daniel Morgan
http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp
http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp
damorgan_at_x.washington.edu
(replace 'x' with a 'u' to reply)
Received on Sat Jan 24 2004 - 08:53:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US