Re: where not exists

Поиск
Список
Период
Сортировка
От Llew
Тема Re: where not exists
Дата
Msg-id a660r3$1207$1@jupiter.hub.org
обсуждение исходный текст
Ответ на Re: where not exists  ("Josh Berkus" <josh@agliodbs.com>)
Список pgsql-sql
Dear Josh,
The reason why I do things is two steps is that this allows me archive the
deleted items.
Llew

""Josh Berkus"" <josh@agliodbs.com> wrote in message
news:web-819049@davinci.ethosmedia.com...
> Llew,
>
> Do it all in one query:
>
> > DELETE FROM a
> >         WHERE NOT EXISTS
> >         (
> >             SELECT b.join1
> >                 FROM b
> >                 WHERE
> >                 a.join1 = b.join1 AND
> >                 a.join2 = b.join2
> >         )
>
> And make sure that join1 and join2 are indexed in both tables.
>
> -Josh Berkus
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org




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

Предыдущее
От: "Llew"
Дата:
Сообщение: Re: where not exists
Следующее
От: jmycr@cs.com
Дата:
Сообщение: subquery involving 'now'