From: Chris Bitmead <chris.bitmead@bigfoot.com>
To: Herouth Maoz <herouth@oumail.openu.ac.il>
Cc: pgsql-sql@postgreSQL.org
Subject: Re: [GENERAL] How to do this in SQL?
Date: Tue, 30 Mar 1999 15:03:37 +0000
Message-ID: <3700E7C9.FCD0D4C5@bigfoot.com> (raw)
References: <l0311070fb32695e2d222@[147.233.148.140]>
Herouth Maoz wrote:
> INSERT INTO BOOK (name, author)
> SELECT 'War and Peace', oid
> FROM author
> WHERE name = 'Tolstoy';
Thanks! Now what if I had...
CREATE TABLE book (author oid, publisher oid);
What is the syntax? Is it...
INSERT INTO BOOK(author, publisher)
SELECT author.oid, publisher.oid
FROM author, publisher
WHERE author.name = 'Tolstoy' AND publisher.name = 'Penguin';
Is that right?
--
Chris Bitmead
http://www.bigfoot.com/~chris.bitmead
mailto:chris.bitmead@bigfoot.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: chris.bitmead@bigfoot.com, herouth@oumail.openu.ac.il
Subject: Re: [GENERAL] How to do this in SQL?
In-Reply-To: <3700E7C9.FCD0D4C5@bigfoot.com>
References: <l0311070fb32695e2d222@[147.233.148.140]> <3700E7C9.FCD0D4C5@bigfoot.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox