X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id A8B2A563DE for ; Mon, 7 Mar 2005 12:35:41 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 39589-06 for ; Mon, 7 Mar 2005 12:35:40 +0000 (GMT) Received: from stan.ringways.co.uk (hub.ringways.co.uk [213.38.87.130]) by svr1.postgresql.org (Postfix) with ESMTP id 21578563BC for ; Mon, 7 Mar 2005 12:35:39 +0000 (GMT) Received: from gary.ringways.co.uk ([10.1.1.2]) by stan.ringways.co.uk with esmtp (Exim 3.22 #1) id 1D8HNG-00014s-00 for pgsql-sql@postgresql.org; Mon, 07 Mar 2005 12:30:14 +0000 Content-Type: text/plain; charset="us-ascii" From: Gary Stainburn Organization: Ringways Garages Ltd To: pgsql-sql@postgresql.org Subject: simple update from select ?? Date: Mon, 7 Mar 2005 12:28:39 +0000 User-Agent: KMail/1.4.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200503071228.39699.gary.stainburn@ringways.co.uk> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200503/95 X-Sequence-Number: 20574 Hi folks I've got a table of pieces of equipment. One piece of equipment may be owned by another piece of equipment, and may own multiple other pieces. To hold the relationship I have a piece_pieces table holding the owner (pp_id) part id and the owned part ids (pp_part). I'v realised I can store this within the original table so I've added an owner attribute. I need to now populate this now from the other table, but I can't work out how. I've got pieces table p_id -- part id p_owner -- new owner attribute piece_pieces table pp_id -- id of owner pp_part -- id of owned -- Gary Stainburn This email does not contain private or confidential material as it may be snooped on by interested government parties for unknown and undisclosed purposes - Regulation of Investigatory Powers Act, 2000