目录
sql如下
select DISTINCT cust_num from b_marketing_transfer_sync_14583 a
left join b_marketing_sync_3710012 b
on a.cust_num = b.cust_num where b.cust_num is NULL;
报错
原因
意思就是说 'cust_num' 指代不明,就是说查询结果出现了多个cust_num,系统不知道你选的是哪一个了,需要指定一下
select DISTINCT a.cust_num
结果
select DISTINCT a.cust_num from b_marketing_transfer_sync_14583 a
left join b_marketing_sync_3710012 b
on a.cust_num = b.cust_num where b.cust_num is NULL;