Received: from alice.stimpy.com (root@alice.stimpy.com [208.211.184.17]) by hub.org (8.8.8/8.7.5) with ESMTP id PAA20730 for ; Thu, 27 Aug 1998 15:27:26 -0400 (EDT) Received: from alice.stimpy.com (alice.stimpy.com [208.211.184.17]) by alice.stimpy.com (8.8.6/8.6.9) with SMTP id MAA17566 for ; Thu, 27 Aug 1998 12:38:45 -0700 Date: Thu, 27 Aug 1998 12:38:44 -0700 (PDT) From: Walt Bigelow To: pgsql-sql@postgresql.org Subject: copy one to many? Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII This is a follow up to my last question on how to use INSERT INTO to copy rows. I have one more hurdle... how can I copy one or more source rows to many dest rows, but with different target library numbers? I have this: INSERT INTO tblspotinfo (librarynumber, spotnumber, spottitle, isci, trt, starttimecode, date, audiotypeid) SELECT '6666', spotnumber, spottitle, isci, trt, starttimecode, date, audiotypeid FROM tblspotinfo WHERE librarynumber = '9988'; Is there a way to say, get all records with the library number = '9988' and copy them to a list of NEW library numbers? So source would be librarynumber 9988, and dest would be 4457, 4458, 4459, 4460 instead of 6666. Is SQL capabile of this or do I need a function on the server side to do this easily? I'm kinda stuck, since the only docs I have on SQL is a crappy MS Access 'developers' book. :-( Thanks, Walt