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

Поиск
Список
Период
Сортировка
От Harald Fuchs
Тема Re: polating (insert into...) a table with determined record from another table.
Дата
Msg-id puiscgvyfy.fsf@srv.protecting.net
обсуждение исходный текст
Ответ на polating (insert into...) a table with determined record from another table.  (Prabu Subroto <prabu_subroto@yahoo.com>)
Ответы Re: polating (insert into...) a table with determined record from another table.
Список pgsql-general
In article <20040722131503.82949.qmail@web41803.mail.yahoo.com>,
Prabu Subroto <prabu_subroto@yahoo.com> writes:

> 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'));

It's far easier:

INSERT INTO sven1 (custid, noapp)
SELECT custid, noapp
FROM appointment
WHERE done = 'N'
  AND salesid = '6'

В списке pgsql-general по дате отправления:

Предыдущее
От: Steve Wampler
Дата:
Сообщение: Best way to recover from crash?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Best way to recover from crash?