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

SELECT DISTINCT and Insert. Interesting question

From: Srini <sriniksk_at_yahoo.com>
Date: 6 Nov 2002 09:11:19 -0800
Message-ID: <2393ddd1.0211060911.1d2d1f6b@posting.google.com>


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 Wed Nov 06 2002 - 11:11:19 CST

Original text of this message

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