Delete with a multi-column join?

From: leon-pg(at)comvision(dot)com
To: pgsql-general(at)postgresql(dot)org
Subject: Delete with a multi-column join?
Date: 2005-01-25 21:16:29
Message-ID: 60F7901C-6F16-11D9-A24C-000A95E07710@comvision.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Howdy! I apologize in advance for the ugly query I'm about to throw
your way....

I need to delete some data from a table based on a multi-column join.
Is there a better way to write this?

delete
from tbldata
where unitID || '_' || variableID || '_' || cycleID in
(select unitID || '_' || variableID || '_' || cycleID from
temp_data_table)

In SQL Server I would just write

delete tblData
from tblData a
inner join temp_data_table b
on a.unitID = b.unitID
and a.variableID = b.variableID
and a.cycleID = b.cycleID

but that doesn't seem to be supported in postgres...

Thanks in advance for you help!

Leon

Responses

Browse pgsql-general by date

  From Date Subject
Next Message John DeSoi 2005-01-25 21:20:15 Re: Postgresql, SQL server and Oracle. Please, help
Previous Message Ben 2005-01-25 21:04:53 Re: Apparently I don't understand full outer joins....