I have the following query, I need to line the account_manager column = to prod_id to distribute the account manager name and do the same for the client_id = prod_id to get the producer_name. I created aliases for the producer table but continue to get the column ambiguously defined error.
Select rg.group_number, rg.group_name, qo.quote_id, qo.effective_date, qo.quote_type, qo.hra_ind, rg.account_manager, a.name as account_manager_name, rg.client_id, name as producer_name
From qo_quote qo,
re_group rg
JOIN producer a ON a.prod_id = rg.account_manager
JOIN producer b ON b.prod_id = rg.client_id,
( select distinct a.group_number, c.prospect_nbr
from re_current_benefits a,
qo_quote b,
qo_account c
where a.quote_id = b.quote_id and b.hra_ind = 'Y' and
a.group_number = c.group_number and c.hcr_ind = '3'
) q1
Where q1.prospect_nbr = qo.prospect_nbr and
q1.group_number = rg.group_number and qo.effective_date = rg.renewal_date and
qo.quote_type = 'B' and qo.quote_expiration_ind is null and qo.hra_ind is null and
qo.mhs_lob_code not in ('DTL1', 'DTL2', 'VIS1')
当您加入具有相同列的表时,您必须从哪个表中找到每个不明确的列,目前您缺少name
b.name as producer_name
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.