Support Questions

Find answers, ask questions, and share your expertise

phoenix delete based on joins

avatar

I need to delete records on a phoenix table based on the join with another phoenix table. Is it possible?

If so can anyone provide the syntax. i dont see a direct way of doing this

1 ACCEPTED SOLUTION

avatar

Some join queries can be rewritten like this:-

delete from source1 where (pk1,pk2) in (select pk1,pk2 from source2);

View solution in original post

2 REPLIES 2

avatar

Some join queries can be rewritten like this:-

delete from source1 where (pk1,pk2) in (select pk1,pk2 from source2);

avatar

Thanks Ankit, it works. but is it the effective way if we have large number of rows. AS we are using an IN condition in the query.