MySQL Forums
Forum List  »  French

Problème compatibilité de requête entre MySql 4.1 et 5.0
Posted by: Alain MILANDRE
Date: March 16, 2007 01:46AM

Bonjour,

J'ai la requête suivante qui fonctionne parfaitement sous MySql 4.1.

SELECT proj.vendeur,
CONCAT(util.nom,' ',util.prenom) AS nomvendeur,
proj.Echeancier_Solde,
IF(IFNULL(societe,'')='', CONCAT(TRIM(cont.nom),' ', TRIM(cont.prenom)), CONCAT(societe, '-', TRIM(cont.nom),' ', TRIM(cont.prenom))) AS contremarque,
proj.insitunumpce, ech.dateecheance, ech.modelibelle, IFNULL(ech.montant,0) AS du, IFNULL(ech.montantregle,0) AS regle,
proj.id, IFNULL(CONCAT(poseurs.nom,' ',poseurs.prenom),'???') AS poseur, IFNULL(ech.montant,0)-IFNULL(ech.montantregle,0) AS reste
FROM p_echeancier AS ech ,p_projet AS proj,t_odv AS cont, s_utilisateurs AS util
LEFT JOIN (SELECT proj.id, Max(pose.datefin) AS 'FIN', poseur.nom, poseur.prenom FROM p_poses pose, t_poseurs poseur, p_projet proj
WHERE proj.id = pose.ownerprojet AND pose.poseur = poseur.id AND ((proj.etat In (1,3,4,5,6,7,8,9,10)) AND proj.AnnuleId=0 AND (TO_DAYS(pose.datefin)>=TO_DAYS(NOW())-366))
GROUP BY proj.id) AS poseurs ON proj.id=poseurs.id
WHERE proj.id=ech.owner AND proj.contact=cont.id AND util.loginname=proj.vendeur AND (proj.valider = 1) AND (proj.IsExpo=0) AND
(proj.etat IN (1,3,4,5,6,7,8,9,10)) AND proj.AnnuleId=0 AND (ech.montant<>0) AND
(( ech.dateecheance>='2006-11-01' AND ech.dateecheance<='2006-11-10') OR ((ech.dateecheance Is Null OR ech.dateecheance=0) AND (ech.montant<>ech.montantregle OR ech.montantregle IS NULL)))
AND proj.vendeur IN ("ADMIN") AND proj.site = "PV"
ORDER BY IF((dateecheance = '0000-00-00') OR (dateecheance IS NULL),'9999-99-99',dateecheance), nomvendeur, poseur, contremarque;

Sous MySql 5.0.37, cette requête me met l'erreur suivante :

[MySql 5.0] ERREUR 1052: Column 'id' in where clause is ambiguous

N'y a-t-il pas de compatiblité ascendante entre ces deux version de MySql ?

Quelqu'un pourrais peut-être me mettre sur une pise quand à l'origine de cette erreur ?

Salutations,

Alain MILANDRE

Options: ReplyQuote


Subject
Views
Written By
Posted
Problème compatibilité de requête entre MySql 4.1 et 5.0
5337
March 16, 2007 01:46AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.