| From: | Chris Bitmead <chris(dot)bitmead(at)bigfoot(dot)com> |
|---|---|
| To: | Herouth Maoz <herouth(at)oumail(dot)openu(dot)ac(dot)il> |
| Cc: | pgsql-sql(at)postgreSQL(dot)org |
| Subject: | Re: [GENERAL] How to do this in SQL? |
| Date: | 1999-03-30 15:03:37 |
| Message-ID: | 3700E7C9.FCD0D4C5@bigfoot.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general pgsql-sql |
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(dot)bitmead(at)bigfoot(dot)com
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Herouth Maoz | 1999-03-30 15:13:48 | Re: [GENERAL] How to do this in SQL? |
| Previous Message | Herouth Maoz | 1999-03-30 14:59:16 | Re: [GENERAL] How to do this in SQL? |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Herouth Maoz | 1999-03-30 15:13:48 | Re: [GENERAL] How to do this in SQL? |
| Previous Message | Herouth Maoz | 1999-03-30 14:59:16 | Re: [GENERAL] How to do this in SQL? |