SQL error-prone point link

In order to urge you to remember more deeply!

example

select *
from
(select pre_apply_no,name
from houbank_analysis_sh.t_xloan_loan_lable
where book_date between '2018-11-01' and '2019-02-28') as a
left join
(select name,phone_num
from houbank_stg.xloan_cr_apo_api_app_cj_contact_stg) as b
on a.pre_apply_no = b.objectid;

The results will complain.

------------------------------------

correct answer:

select * from 

(select pre_apply_no,name
from houbank_analysis_sh.t_xloan_loan_lable
where book_date between '2018-11-01' and '2019-02-28') as a
left join
(select objectid,name,phone_num
from houbank_stg.xloan_cr_apo_api_app_cj_contact_stg) as b
on a.pre_apply_no = b.objectid;

tips: Using this field talk is connected required presence subtable

Guess you like

Origin www.cnblogs.com/huangchenggener/p/10951285.html