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: SELECT DISTINCT and Insert. Interesting question

Re: SELECT DISTINCT and Insert. Interesting question

From: Srini <sriniksk_at_yahoo.com>
Date: 8 Nov 2002 16:11:08 -0800
Message-ID: <2393ddd1.0211081611.2a813896@posting.google.com>


Thanks... Matthias and TurkBear.

I'm going to remove the primary key.

Thanks for your time.
Srini.

Matthias Rogel <rogel_at_web.de> wrote in message news:<aqd449$95jhi$1_at_ID-86071.news.dfncis.de>...
> look at the two rows
> f1 = 'a', f2 = 'bc'
> f1 = 'ab', f2 = 'c'
>
> they are distinct, but
> f1 || f2 are the same.
>
> mr
>
> Srini wrote:
> > Hi,
> >
> > Here is an interesting question seeking for expert's advice.
> >
> > SELECT DISTINCT f1, f2, f3 ...
> > INTO v1, v2, v3....
> > FROM t1, t2....
> > WHERE t1.f1 = t2.f1 ....
> > ORDER BY t1.f1;
> >
> > Now I'm trying dump the result into a Temporary table [has only one
> > coulmn varchar2(255)] like:
> >
> > INSERT INTO temp_table(f1) values (v1 || v2 || v3....)
> >
> > If the 'f1' in 'temp_table' is the Primary Key, I'm getting Unique
> > Constraint error. I was expecting the SELECT DISTINCT to return
> > unique row.
> >
> > Any clue what am I doing wrong here.
> > Appreciate your valuable time.
> >
> > Srini.
Received on Fri Nov 08 2002 - 18:11:08 CST

Original text of this message

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