Re: Inserting data of two other tables [Now deleting ...] - Mailing list pgsql-novice

From papapep
Subject Re: Inserting data of two other tables [Now deleting ...]
Date
Msg-id 3ED342E2.1020902@gmx.net
Whole thread Raw
In response to Re: Inserting data of two other tables [Now deleting ...]  (Nabil Sayegh <postgresql@e-trolley.de>)
Responses Re: Inserting data of two other tables [Now deleting ...]
List pgsql-novice
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Nabil Sayegh wrote:

| DELETE FROM a WHERE datum='17.07.1999'::date
~                            ^^^^^^^^^^^^
            This data is not in the "a" table, is in the b one. And the records I
need to remove are the ones from the b table. Will it work this way?


| AND NOT EXISTS (SELECT NULL FROM b WHERE b.field=a.field);

What does this part do? It selects rows where b.field and a.field are
not the same? And the "AND NOT EXISTS"? It inverts the query? I mean, if
the intraparenthesys part selects the rows where b.field <> a.field,
after you change the "sign", selecting the rows that DO have the
b.field=a.field?

I'm a bit confused...

Josep Sànchez
~ [papapep]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQE+00Lh2vx52x0kyz4RArDQAKDODxurcQ8vAcm2Yqpwy++JoAKkfQCgrlH8
ffb9xgmRvQd2HH/0ycT9u8M=
=D900
-----END PGP SIGNATURE-----




pgsql-novice by date:

Previous
From: Rory Campbell-Lange
Date:
Subject: Re: Functions or Rules and Views?
Next
From: Nabil Sayegh
Date:
Subject: Re: Double quoted column within CREATE TABLE statement