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 16:59:08
Message-ID: 3ED4EADC.6040108@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Well, at last I've been able (with some help ;-D) to do it.

The query has been:

SELECT tarneto FROM detalltrajectes d WHERE d.journey = (SELECT c.pkey
FROM CAPTRAJECTES WHERE c.pkey = d.journey AND fecha = 20030423);

With this one I've been able to "see" what was I going to remove, and
with this one:

DELETE FROM DETALLTRAJECTES WHERE journey = (SELECT pkey FROM
CAPTRAJECTES WHERE pkey = journey AND fecha = 20030423);

I have removed the rows. I have to mention that I first tried to "clone"
the query, changing SELECT tarneto for DELETE obviously, but it didn't
work. The parser said:

ERROR: parser: parse error at or near "d"

So what I did was to remove all the alias and it worked.... is it normal??

Thanks to all for your help, and specially to Nabil.

Josep Sànchez
[papapep]

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message eurlix 2003-05-28 19:38:21 How to obtain a good ASCII order ?
Previous Message Bruno Wolff III 2003-05-28 14:51:07 Re: Create Table Unique problem... bug?