Steven Rosenstein wrote:
DELETE FROM detail JOIN summary ON (summary.id=detail.sum_id) WHERE
collect_date='2005-02-05';
DELETE FROM detail WHERE detail.sum_id in ( select id from summary )
AND collect_date='2005-02-05';
Regards
Gaetano Mendola
---(end of
On Sun, Feb 06, 2005 at 12:16:13PM -0500, Steven Rosenstein wrote:
DELETE FROM detail JOIN summary ON (summary.id=detail.sum_id) WHERE
collect_date='2005-02-05';
But I keep getting a parser error. Am I not allowed to use JOINs in a
DELETE statement, or am I just fat-fingering the SQL text
Gaetano Mendola wrote:
Steven Rosenstein wrote:
DELETE FROM detail JOIN summary ON (summary.id=detail.sum_id) WHERE
collect_date='2005-02-05';
You have to tell it what table you are deleting from. Select * from A
join B is both tables. What you want to do is fix the where clause.
DELETE FROM
Re: [PERFORM] Are JOINs allowed
with DELETE FROM
Steven Rosenstein [EMAIL PROTECTED] writes:
Thank you for the link to the documentation page. I forgot to mention that
we're still using version 7.3. When I checked the 7.3 documentation for
DELETE, there was no mention of being able to use fields from different
tables in a WHERE clause.
Many thanks to Gaetano Mendola and Tom Lane for the hints about using
fields from other tables in a DELETE's WHERE clause. That was the magic
bullet I needed, and my application is working as expected.
--- Steve