我需要在Python中复制下面的SQL查询并在python中获得结果。
select a.customer_id as custid_tab1, a.country_id as ctryid_tab1, b.customer_id_tab2 as custid_tab2, b.country_id_tab2 as ctryid_tab2, c.customer_id_tab3 as custid_tab3, c.country_id_tab3 as ctryid_tab3
from table1 a
left join table2 b
on a.customer_id=b.customer_id
left join table3 c
on a.customer_id=c.customer_id
where b.customer_id is null
and c.customer_id is null
table1
customer_id country_id
101 5
102 5
103 5
104 5
105 5
106 5
107 5
108 5
109 5
110 5
table2
customer_id country_id
101 5
102 5
104 5
105 5
106 5
108 5
109 5
110 5
table3
customer_id country_id
101 5
103 5
104 5
105 5
106 5
107 5
110 5
Final output
customer_id_tab1 country_id_tab1 customer_id_tab2 country_id_tab2 customer_id_tab3 country_id_tab3
101 5 101 5 101 5
104 5 104 5 104 5
105 5 105 5 105 5
106 5 106 5 106 5
110 5 110 5 110 5
已使用上述SQL代码获得了以上输出。现在,我需要在Python中获得相同的输出。
请帮助!
亲切的问候, 斯里坎特
答案 0 :(得分:0)