Thread: insert woes

insert woes

From
tony
Date:
Hi,

I am migrating data from one data structure to another and having
problems writing a correct INSERT INTO blah SELECT ... from existing
tables

I have contact, my addresses (each contact can have several addresses)
and address (each address can have several contacts).

I am getting unique key address_id errors despite using a DISTINCT ON
clause in my SELECT so I am doing something wrong

Please slap me around the head to set my ideas straight again =:-D

Tony


Re: insert woes

From
Richard Huxton
Date:
tony wrote:
> Hi,
>
> I am migrating data from one data structure to another and having
> problems writing a correct INSERT INTO blah SELECT ... from existing
> tables
>
> I have contact, my addresses (each contact can have several addresses)
> and address (each address can have several contacts).
>
> I am getting unique key address_id errors despite using a DISTINCT ON
> clause in my SELECT so I am doing something wrong

Copies of the queries in question please. Also, cut the INSERT INTO off
the front and have a look for any duplicates.

--
   Richard Huxton
   Archonet Ltd

Re: insert woes

From
tony
Date:
Le mardi 05 avril 2005 à 09:43 +0100, Richard Huxton a écrit :

> Copies of the queries in question please. Also, cut the INSERT INTO off
> the front and have a look for any duplicates.

Sorry, I was just looking for a logic booster not SQL correction and I
thought of trying without the INSERT INTO just after posting. Posting a
silly question always gets the brain working again I find =:-D

Thanks

Tony