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