Re: Inserting data of two other tables

Поиск
Список
Период
Сортировка
От Manfred Koizar
Тема Re: Inserting data of two other tables
Дата
Msg-id fesscvo788pb6v8908s9ppahaalc4erogm@4ax.com
обсуждение исходный текст
Ответ на Inserting data of two other tables  (papapep <papapep@gmx.net>)
Ответы Re: Inserting data of two other tables [Now deleting ...]  (papapep <papapep@gmx.net>)
Список pgsql-novice
On Fri, 23 May 2003 20:45:32 +0200, papapep <papapep@gmx.net> wrote:
>INSERT INTO totaltrajectes ([...])
>SELECT [...]
>FROM captrajectes,detalltrajectes
>
>Also I have to mention that this sentence works with about 650.000 rows
>~                                in the table "detalltrajectes" and
>35.000 in the "captrajectes" one.

>Does anybody know a more effective way to fill the new table?

Yes.  Use a WHERE clause :-)  Your join produces 650000 * 35000 rows.
This should work:

    ... FROM captrajectes AS c, detalltrajectes AS d
    WHERE c.pkey = d.journey;

Servus
 Manfred

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

Предыдущее
От: papapep
Дата:
Сообщение: Inserting data of two other tables
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Inserting data of two other tables