Path: text.usenetserver.com!out03b.usenetserver.com!news.usenetserver.com!in02.usenetserver.com!news.usenetserver.com!postnews.google.com!22g2000hsm.googlegroups.com!not-for-mail
From:  roman.morokutti@googlemail.com
Newsgroups: comp.databases.oracle.misc
Subject: Multiple datasets in one dataset
Date: Wed, 10 Oct 2007 00:07:11 -0700
Organization: http://groups.google.com
Lines: 51
Message-ID: <1192000031.838733.84970@22g2000hsm.googlegroups.com>
NNTP-Posting-Host: 217.91.100.44
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
X-Trace: posting.google.com 1192000032 22237 127.0.0.1 (10 Oct 2007 07:07:12 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Wed, 10 Oct 2007 07:07:12 +0000 (UTC)
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7,gzip(gfe),gzip(gfe)
Complaints-To: groups-abuse@google.com
Injection-Info: 22g2000hsm.googlegroups.com; posting-host=217.91.100.44;
   posting-account=ps2QrAMAAAA6_jCuRt2JEIpn5Otqf_w0
Xref: usenetserver.com comp.databases.oracle.misc:250182
X-Received-Date: Wed, 10 Oct 2007 03:07:12 EDT (text.usenetserver.com)

Hi,

I have the following problem. I have a table with the following
schema:

CREATE TABLE FOO
   (	"WP" VARCHAR2(10 BYTE),
	"VALUE_GROUP" NUMBER(4,0),
	"CURR_MS" NUMBER(38,0),
	"VALUE_1" NUMBER(13,3),
	"VALUE_2" NUMBER(13,3),
	"VALUE_3" NUMBER(13,3),
	"VALUE_4" NUMBER(13,3),
	"VALUE_5" NUMBER(13,3),
	"VALUE_6" NUMBER(13,3),
	"VALUE_7" NUMBER(13,3),
	"VALUE_8" NUMBER(13,3),
	"VALUE_9" NUMBER(13,3),
	"VALUE_10" NUMBER(13,3)
   );

The PK is WP, VALUE_GROUP, CURR_MS.

In this table there are several datasets which are grouped by CURR_MS.
And sets with this unique ID should be selected to be shown in one
line.
This would be no problem if there would be always the same number of
lines grouped by one uniquely id (CURR_MS). The following statement
does this job:

This one consists of 3 values:

select a.*, b.*, c.* from foo a, foo b, foo c
 where a.wp = '418'
   and a.value_group = 11 and b.value_group = 21 and c.value_group =
22
   and a.curr_ms = 28144336
   and a.curr_ms = curr_ms
   and a.curr_ms = curr_ms
   and a.wp = b.wp
   and a.wp = c.wp
;

But there are several groups which consists solely of 1 or 2 lines. Is
it possible to get them also with the same statement? Your help would
be greatly appreciated. Thanks in advance.

Regards

Roman

