X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 6E1BDD1C514 for ; Mon, 11 Aug 2003 10:17:40 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 77294-04 for ; Mon, 11 Aug 2003 07:16:13 -0300 (ADT) Received: from mail.informatik.hu-berlin.de (mail.informatik.hu-berlin.de [141.20.20.50]) by svr1.postgresql.org (Postfix) with ESMTP id 086FAD1C47A for ; Mon, 11 Aug 2003 07:17:29 -0300 (ADT) Received: from informatik.hu-berlin.de (karotte [141.20.27.143]) (authenticated bits=0) by mail.informatik.hu-berlin.de (8.12.9/8.12.9/INF-2.0-MA-SOLARIS-2.8) with ESMTP id h7BAHUe5005098 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 11 Aug 2003 12:17:30 +0200 (MEST) Message-ID: <3F376E13.7080907@informatik.hu-berlin.de> Date: Mon, 11 Aug 2003 12:21:07 +0200 From: Silke Trissl User-Agent: Mozilla/5.0 (X11; U; Linux i686; de-AT; rv:1.4) Gecko/20030624 X-Accept-Language: de-at, de, en-us, en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: INSERT INTO ... SELECT Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=1.0 tagged_above=0.0 required=5.0 tests=SUBJ_ALL_CAPS, USER_AGENT_MOZILLA_UA, X_ACCEPT_LANG X-Spam-Level: * X-Archive-Number: 200308/112 X-Sequence-Number: 14728 Hi, I would like to insert into a table values from a table and user defined ones. Here is the example: I found this statement to insert values from another table: INSERT INTO test_table (cust_id, cust_name) SELECT id, name from CUSTOMER; But the test_table has another column, which should have the same value for all the customers. Is there something like INSERT INTO test_table (int_id, cust_id, cust_name) '1', SELECT id, name from CUSTOMER: and if so, what ist the correct statement? If not, what is an alternative to insert a single row at a time? Thanks in advance Silke