Re: [GENERAL] DELETE and JOIN - Mailing list pgsql-general

From Tom Lane
Subject Re: [GENERAL] DELETE and JOIN
Date
Msg-id 13377.1489424016@sss.pgh.pa.us
Whole thread Raw
In response to [GENERAL] DELETE and JOIN  (Alexander Farber <alexander.farber@gmail.com>)
List 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 by date:

Previous
From: Alexander Farber
Date:
Subject: [GENERAL] DELETE and JOIN
Next
From: Adrian Klaver
Date:
Subject: Re: [GENERAL] DELETE and JOIN