Column 'pdt_fam_id' in where clause is ambiguous
select P1.pdt_id,P1.pdt_libelle,P2.pdt_id as pdt_id_pere
from nf_com_produit P1
left join nf_com_produit as P2 on ( P1.pdt_id = P2.pdt_pdt_id )
left join nf_com_pdt_per as ja on ( ja.ppe_pdt_id=P1.pdt_id )
left join nf_gen_famille as fa on ( P1.pdt_fam_id=fam_id )
left join nf_com_personnalite as a on ( ja.ppe_per_id=a.per_id and a.per_tpe_id=1 and a.per_etat=1 )
left join nf_com_pdt_per as je on ( je.ppe_pdt_id=P1.pdt_id )
left join nf_com_personnalite as e on ( je.ppe_per_id=e.per_id and e.per_tpe_id=6 and e.per_etat=1 )
left join nf_com_pdt_per as jr on ( jr.ppe_pdt_id=P1.pdt_id )
left join nf_com_personnalite as r on ( jr.ppe_per_id=r.per_id and r.per_tpe_id=2 and r.per_etat=1 )
left join nf_com_pdt_per as jac on ( jac.ppe_pdt_id=P1.pdt_id )
left join nf_com_personnalite as ac on ( jac.ppe_per_id=ac.per_id and ac.per_tpe_id=3 and ac.per_etat=1 )
left join nf_com_pdt_per as jl on ( jl.ppe_pdt_id=P1.pdt_id )
left join nf_com_personnalite as l on ( jl.ppe_per_id=l.per_id and l.per_tpe_id=5 and l.per_etat=1 )
left join nf_com_collection on ( P1.pdt_coe_id=coe_id and coe_etat=1)
left join nf_com_theme on ( P1.pdt_thm_id=thm_id )
inner join nf_com_pdt_bou PB on ( PB.pbo_pdt_id=P1.pdt_id )
left join nf_com_pdt_bou PB2 on ( PB2.pbo_pdt_id=P2.pdt_id )
where P1.pdt_etat=1 AND (P1.pdt_flag_telechargement = 0 OR P1.pdt_pdt_id IS NULL OR P1.pdt_pdt_id = 0) AND PB.pbo_montant_ttc>0 and pdt_fam_id not in (22,23,24,25,26,62,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80) and P1.pdt_dis_id in (1,2,7,8)
group by P1.pdt_id
limit 0, 6