Good morning and thank you for the replies.
I've ended up with the following DELETE USING (in order to delete reviews
coming from different user id, but same IP address in the last 24 hours):
DELETE FROM words_reviews r
USING words_users u
WHERE r.uid = u.uid
On Mon, Mar 13, 2017 at 9:39 AM, Alexander Farber <
alexander.far...@gmail.com> wrote:
> Good evening,
>
> In a 9.5 database I would like players to rate each other and save the
> reviews in the table:
>
> CREATE TABLE words_reviews (
> uid integer NOT NULL CHECK (uid <> author)
On 03/13/2017 09:39 AM, Alexander Farber wrote:
Good evening,
In a 9.5 database I would like players to rate each other and save the
reviews in the table:
CREATE TABLE words_reviews (
uid integer NOT NULL CHECK (uid <> author) REFERENCES
words_users ON DELETE CASCADE,
author
Alexander Farber 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
Good evening,
In a 9.5 database I would like players to rate each other and save the
reviews in the table:
CREATE TABLE words_reviews (
uid integer NOT NULL CHECK (uid <> author) REFERENCES words_users
ON DELETE CASCADE,
author integer NOT NULL REFERENCES words_users(uid) ON
Tom Lane wrote:
Gwyneth Morrison [EMAIL PROTECTED] writes:
What I am actually trying to get past is:
DELETE FROM data_table1
using data_table2 INNER JOIN
data_table1 ON data_table1.fkey =
data_table2.pkey;
Scott Marlowe wrote:
Take a look here, in the notes section:
http://www.postgresql.org/docs/8.3/interactive/sql-delete.html
on the using keyword.
Thank you for your reply Scott,
I guess this is where the confusion started for me.
It says here in your reference that the using clause is
--- On Wed, 7/2/08, Gwyneth Morrison [EMAIL PROTECTED] wrote:
From: Gwyneth Morrison [EMAIL PROTECTED]
Subject: Re: [GENERAL] Delete from Join
To: pgsql-general@postgresql.org
Date: Wednesday, July 2, 2008, 7:12 PM
--- On Wed, 7/2/08, Gwyneth Morrison
[EMAIL PROTECTED] wrote
Gwyneth Morrison [EMAIL PROTECTED] writes:
What I am actually trying to get past is:
DELETE FROM data_table1
using data_table2 INNER JOIN
data_table1 ON data_table1.fkey =
data_table2.pkey;
The equivalent to that in Postgres would be
Hello,
Is it possible to use a join keyword in a delete?
For example:
DELETE FROM data_table1
using data_table2 INNER JOIN
data_table1 ON data_table1.fkey = data_table2.pkey;
It is not directly mentioned in the delete syntax but the delete refers
--- On Wed, 7/2/08, Gwyneth Morrison [EMAIL PROTECTED] wrote:
From: Gwyneth Morrison [EMAIL PROTECTED]
Subject: [GENERAL] Delete from Join
To: pgsql-general@postgresql.org
Date: Wednesday, July 2, 2008, 3:15 PM
Hello,
Is it possible to use a join keyword in a delete?
For example
--- On Wed, 7/2/08, Gwyneth Morrison [EMAIL PROTECTED] wrote:
From: Gwyneth Morrison [EMAIL PROTECTED]
Subject: [GENERAL] Delete from Join
To: pgsql-general@postgresql.org
Date: Wednesday, July 2, 2008, 3:15 PM
Hello,
Is it possible to use a join keyword in a delete
Take a look here, in the notes section:
http://www.postgresql.org/docs/8.3/interactive/sql-delete.html
on the using keyword.
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
I am currently migrating from MySQL to PostgreSQL and I have found
that some queries do not work. For instance,
DELETE t1 FROM t1 LEFT JOIN t2 USING (column_id) WHERE t2.column_id IS NULL;
works in MySQL. This works as expected even though the MySQL
documentation does not mention the option of
On Wed, Jul 27, 2005 at 15:28:36 -0400,
Brian Wong [EMAIL PROTECTED] wrote:
I am currently migrating from MySQL to PostgreSQL and I have found
that some queries do not work. For instance,
DELETE t1 FROM t1 LEFT JOIN t2 USING (column_id) WHERE t2.column_id IS NULL;
works in MySQL. This
On Wed, 27 Jul 2005, Brian Wong wrote:
I am currently migrating from MySQL to PostgreSQL and I have found
that some queries do not work. For instance,
DELETE t1 FROM t1 LEFT JOIN t2 USING (column_id) WHERE t2.column_id IS NULL;
works in MySQL. This works as expected even though the MySQL
On 7/27/05, Stephan Szabo [EMAIL PROTECTED] wrote:
I think the where t2.column_id is null where column_id is the joining
column makes this a form of not exists, so maybe:
DELETE FROM t1 WHERE NOT EXISTS (SELECT 1 FROM t2 WHERE t2.column_id =
t1.columnid);
This looks good. Thanks.
17 matches
Mail list logo