Delete from a table with JOIN

From: Noel <noel(dot)faux(at)med(dot)monash(dot)edu(dot)au>
To: pgsql-novice(at)postgresql(dot)org
Subject: Delete from a table with JOIN
Date: 2004-01-12 06:37:46
Message-ID: 400240BA.50505@med.monash.edu.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi,

I'm trying to delete from a table based on a foreign key from another table.
I've tried this:
DELETE FROM a
FROM a LEFT JOIN b
ON a.b = b.id
WHERE b.foo = 100

Also tried with the second FROM dropped.
All I get is a parse error:
parser: parse error at or near "JOIN" at character 11, just after first
FROM a.

Any suggestions would be appreciated
Cheers

--
Noel Faux
Department of Biochemistry and Molecular Biology
Monash University
Clayton 3168
Victoria
Australia

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Brown 2004-01-12 11:34:10 Re: plpython trigger
Previous Message Rob 2004-01-12 06:11:22 New at this. Commissioning for the first time: