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: Need urgent help on SQL query

Re: Need urgent help on SQL query

From: nope <don't_at_use.this>
Date: 1998/04/06
Message-ID: <3529301A.6D0C@use.this>#1/1

Sree wrote:
>
> Hi All ,
>
> I have two tables I need to get a sql report from this tables the data in
> the tables loaded using sql*loader. I tried in different ways but I couldnt
> able to get it right,
> I thought somebody out there more smart than me. I would like to know
> something like this possible or any other ideas of doing like this.
> I really appreciate your immediate response.
>
> You can reply to v-sreev_at_microsoft.com or SVupalanch_at_aol.com
>
> (TABLE A) The columns are item, loc, startdate, qty.
>
> ITEM LOC STARTDATE QTY
>
> A01 Hunt 01-jan-98 2000(TOTAL)
>
> (TABLE B)
>
> In table B the Columns are Item#, comp_part#, class, subclass
>
> ITEM# COMP_PART# CLASS SUBCLASS
>
> A01 X03-22163 Media CD
> A01 X03-43636 Media CD
> A01 X03-58632 Media CD
> A01 X03-53687 Media Set CD
> A01 X03-58631 Media Set CD
> A01 X03-61023 Media Set CD
> A01 X03-22156 Media Set CD PR
> A01 X03-43617 Media Set CD PR
> A01 X03-58629 Media Set CD PR
> A01 X03-09183 Print Mat CD Lab
> A01 X03-22172 Print Mat CD Lab
> A01 X03-43640 Print Mat CD Lab
>
> output should be in the followning format
>
> ITEM DATE QTY CDSET CD-PRINT MEDIA_SET CD-LABSET
>
> A01 01-jan-98 X03-22163 X03-22156 X03-53687 X03-9183
> A01 01-JAN-98 X03-43636 X03-43617 X03-58631 X03-22172
> A01 01-JAN-98 X03-58632 X03-58629 X03-61023 X03-43640
Gee,

are you sure that's all what's in table B? the only way I could reconstruct
your result was by putting all the first (2nd,3rd) occurrences of each COMP_PART#-type on the same row. But how would you tell Oracle that it wasn't e.g.  

A01 01-jan-98 X03-22163 X03-43617 X03-61023 X03-43640

In other words you need one more identifier in table B which links together the right CDSET CD-PRINT MEDIA_SET CD-LABSET #s.

Christian Received on Mon Apr 06 1998 - 00:00:00 CDT

Original text of this message

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