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-28 12:52:46
Message-ID: 3ED4B11E.9000209@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I've made a try with this:

SELECT count(journey) from DETALLTRAJECTES where EXISTS (SELECT NULL
from CAPTRAJECTE,DETALLTRAJECTES where pkey=journey and fecha=20030423);

and it doesn't work properly (at least it doesn't do what I need...)

In my last mail (this is for Nabil) I made a mistake in what I told you.
The date to filter the rows to remove is in CAPTRAJECTES, and the rows
to remove are in DETALLTRAJECTES. CAPTRAJECTES has a field called "pkey"
and DETALLTRAJECTES another called "journey" that are the join between
the two tables.

When I execute the select above noted it returns me about 15.000 rows.
But if I make this one:

SELECT count(journey) from CAPTRAJECTES,DETALLTRAJECTES where
pkey=journey and fecha=20030423;

it only returns me about 5.000. So the first one has any error in the
conception.

Where do I make the mistake? (thanks you all for your patience.....)

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

iD8DBQE+1LEd2vx52x0kyz4RAqk0AKDOo3ZoYTYKC5Pcfgov90+CLydxCwCfVgXM
RF+NLu0hs6iyR+QKGkjCbzk=
=wOrJ
-----END PGP SIGNATURE-----

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Nabil Sayegh 2003-05-28 13:25:28 Re: Inserting data of two other tables [Now deleting ...]
Previous Message Nabil Sayegh 2003-05-28 12:02:29 Re: nOOb Alert..Need some help..