Re: Inserting data of two other tables [Now deleting ...]

From: papapep <papapep(at)gmx(dot)net>
To: pgsql-novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Inserting data of two other tables [Now deleting ...]
Date: 2003-05-27 10:50:10
Message-ID: 3ED342E2.1020902@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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-----

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Nabil Sayegh 2003-05-27 11:36:40 Re: Double quoted column within CREATE TABLE statement
Previous Message Rory Campbell-Lange 2003-05-27 09:36:01 Re: Functions or Rules and Views?