Mercer Mercer - 3 months ago 10
SQL Question

The multi-part identifier can not be bound

I have this request

SELECT ACC.ID_LIENPARENTE,
ACC.ID_VOYAGE,
ACC.LI_ACC_NOM,
ACC.LI_ACC_PRENOM,
ACC.PA_ID_INDICATIF_TEL,
ACC.CO_ACC_MEL,
ACC.TE_ACC_TELEPHONE,
E_PAYS.PA_ID AS PA_ID_INDICATIF_TEL_ACC,
E_PAYS.PA_I_INDICATIF AS PA_INDICATIF_TEL_ACC,
E_PAYS.PA_L_NOM_LISTE as PA_L_NOM_LISTE_INDICATIF_TEL_ACC
FROM
dbo.E_ACCOMPAGNANT ACC
JOIN E_PAYS ON E_ACCOMPAGNANT.PA_ID_INDICATIF_TEL = E_PAYS.PA_ID
INNER JOIN dbo.R_LIEN_PARENTE LIEN_PAR
ON
ACC.ID_LIENPARENTE = LIEN_PAR.ID_LIENPARENTE
WHERE ID_VOYAGE = 10


when i execute this i have this error message:


The multi-part identifier " E_ACCOMPAGNANT.PA_ID_INDICATIF_TEL " can
not be bound.


What is wrong

Answer

If you define an alias name for a table, then you have to use it always.
Replace

JOIN E_PAYS ON E_ACCOMPAGNANT.PA_ID_INDICATIF_TEL = E_PAYS.PA_ID

with

JOIN E_PAYS ON ACC.PA_ID_INDICATIF_TEL = E_PAYS.PA_ID
Comments