polating (insert into...) a table with determined record from another table.

From: Prabu Subroto <prabu_subroto(at)yahoo(dot)com>
To: Postgres General Milis <pgsql-general(at)postgresql(dot)org>
Subject: polating (insert into...) a table with determined record from another table.
Date: 2004-07-22 13:15:03
Message-ID: 20040722131503.82949.qmail@web41803.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dear my friends...

I created a table (named : sven1). I want to populate
this table with the record from another table (named :
appoinment).
but I don't know how to formulate the sql query.

I tried this one:
insert into sven1 (custid, noapp) values ((select
custid from appointment where done='N' and
salesid='6'), (select noapp from appointment where
done='N' and salesid='6'));

But I got this error in my psql console:
kv=# insert into sven1 (custid, noapp) values ((select
custid from appointment where done='N' and
salesid='6'), (select noapp from appointment where
done='N' and salesid='6'));
ERROR: more than one row returned by a subquery used
as an expression
kv=#

Anybody would be so nice to help me solving this
problem?

Thank you very much in advance.


__________________________________
Do you Yahoo!?
Yahoo! Mail is new and improved - Check it out!
http://promotions.yahoo.com/new_mail

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Holger Klawitter 2004-07-22 13:18:06 Re: 2 postgresql processes on the same machine ?
Previous Message Oliver Elphick 2004-07-22 13:09:22 Re: 2 postgresql processes on the same machine ?