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

Home -> Community -> Usenet -> c.d.o.server -> Re: Question on Select Statement

Re: Question on Select Statement

From: Jerry Abramson <jerry_abramson_at_stratus.com>
Date: 1997/08/21
Message-ID: <33FC6DE6.466A@stratus.com>#1/1

Chinh Nguyen wrote:
>
> Hi,
> I have a master/detail relationship tables as below:
>
> create table Master(PrimKey number, Otherkey varchar2(20));
> insert into Master values (1,'HELLO');
> insert into Master values (2,'BYE');
>
> create table Detail(ForeignKey number, column1 number);
> insert into Detail values (1, 200);
> insert into Detail values (1, 300);
> insert into Detail values (1, 400);
>
> commit;
>
> Question:
>
> Can I construct a select statement that will return "one and only one"
> row containing all detail for this tables relationship.
>
> The idea result row shoud look like:
>
> 1 HELLO 200 300 400
>
> Thanks in advance for your help.

I sure hope that you cannot do what you desire. A key aspect of relational
databases is the notion of a result set. You can get a result set like this,
and iterate over each detail value. For your desired result, how would you know how many detail columns to expect?

		detail
	- ----- ---
	1 HELLO 200
	1 HELLO 300
	1 HELLO 400


-- 
------------------------------------------------------------------
                                                    Jerry Abramson
                                      Stratus Computer Corporation
                  jerry_abramson_at_stratus.com [Work]
Received on Thu Aug 21 1997 - 00:00:00 CDT

Original text of this message

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