Search Postgresql Archives

Delete with a multi-column join?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

              http://www.postgresql.org/docs/faq


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux