Re: [SQL] howto delete using a join ?

2010-07-24 Thread Joshua Tolley
On Sat, Jul 24, 2010 at 06:05:57AM +0200, Andreas wrote: > Hi, > > is there a way to delete from a table using information from another > table to decide if a row should be dropped? Yes. See DELETE ... USING http://www.postgresql.org/docs/8.4/interactive/sql-delete.html -- Joshua Tolley / egg

Re: [SQL] howto delete using a join ?

2010-07-24 Thread Dmitriy Igrishin
Hey Andreas, You may want to use the USING clause: DELETE FROM events USING event_types WHERE events.event_type_fk = event_types.event_type.id AND relevance_level IN ( 1, 3, 5, 7) AND ; Regards, Dmitriy