fix agent double
Anonymous
pgsql
09/02/2024 12:55 PM
1.1 KB
18
Indexable
-- check apakah ada dengan agent id tersebut select agent_id from advertises where agent_id = (select id from agents where email = '[email protected]'); -- jika tidak ada maka bisa delete dibawah ini delete from agents where office_id = (select id from office_agents where office_agents.email = '[email protected]') and is_pic = true; delete from partners where email = '[email protected]'; -- namun jika ada maka --masukan id agent yg engga boleh di hapus; delete from agents where office_id = (select id from office_agents where office_agents.email = '[email protected]') and is_pic = true and id != 0; --masukan id agent yg engga boleh di hapus; --masukan id agent yg engga boleh di hapus; delete from partners where email = '[email protected]' and agent_id != 0;
Editor is loading...
Leave a Comment