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 -> Why are there DUPES!?!?

Why are there DUPES!?!?

From: Marc Connolly <marcon33_at_home.com>
Date: Thu, 23 Aug 2001 04:53:34 GMT
Message-ID: <i%%g7.2949$e91.1187822@news1.sttln1.wa.home.com>


I am getting dupes and for the life of me can not see why. My latest guess at a solution is to
create a composite key in table pn_sc that includes "sc"? I am lost and this is just a stab in the
dark. Any help really appreciated!

here is the query :

INSERT INTO cat_sales_one
SELECT catcode, datesold, sum(extprice) as sumextprice FROM mo_sold_extprice, pn_sc, category
WHERE mo_sold_extprice.pn = pn_sc.pn
AND pn_sc.sc = category.sc
AND div = 'T'
GROUP BY cat, datesold, div

here are the tables.

mo_sold_extprice

LOC                        NOT NULL VARCHAR2(4)
PARTNO                NOT NULL VARCHAR2(18)
DATESOLD            NOT NULL DATE
QTY                        FLOAT(126)
EXTDN                    FLOAT(126)
DIV                            VARCHAR2(1)


pn_sc
PARTNO             NOT NULL VARCHAR2(18)
SC                        VARCHAR2(4)

category
SC                         NOT NULL VARCHAR2(4)
CATCODE            NOT NULL VARCHAR(2)
SCDESC                    VARCHAR2(30)
Received on Wed Aug 22 2001 - 23:53:34 CDT

Original text of this message

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