Re: [GENERAL] DELETE and JOIN

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [GENERAL] DELETE and JOIN
Дата
Msg-id 13377.1489424016@sss.pgh.pa.us
обсуждение исходный текст
Ответ на [GENERAL] DELETE and JOIN  (Alexander Farber <alexander.farber@gmail.com>)
Список pgsql-general
Alexander Farber <alexander.farber@gmail.com> writes:
> ...
> However, before saving a review, I would like to delete all previous
> reviews coming from the same IP in the past 24 hours:
> ...
> I have the feeling that the _author_ip variable is not really necessary and
> I could use some kind of "DELETE JOIN" here, but can not figure it out.

Sure, see the USING clause in DELETE.  Although your example seems a
bit confused, since you're not actually referring to _author_ip anywhere.
And if you meant "_author_ip" where you wrote "u._author_ip", that's in
a sub-SELECT, where you could just add a join to words_users without
needing any nonstandard DELETE syntax.

            regards, tom lane


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

Предыдущее
От: Alexander Farber
Дата:
Сообщение: [GENERAL] DELETE and JOIN
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: [GENERAL] DELETE and JOIN