How to join to delete

From: "Chris Velevitch" <chris(dot)velevitch(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: How to join to delete
Date: 2006-05-02 06:53:58
Message-ID: b0a3bf780605012353u7799e90av2a2bb71b0eaec41e@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I'm using pg 7.4.5 on Win XP SP1.

I want to delete rows from a table B, but need to join it to another
table A in order to select the rows in B to be deleted.

Eg. Delete from A join B on (A.bk = B.bk) where A.ak = x;

but only delete rows from B.

How do I acheive this?

Chris
--
Chris Velevitch
Manager - Sydney Flash Platform Developers Group
www.flashdev.org.au

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Don Y 2006-05-02 07:00:04 Return value (instead of reference) for user defined type
Previous Message Tom Lane 2006-05-02 00:32:48 Re: insert into a view?