Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

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.