I'm evaluating SQLYog and found the formatting feature quite useful, but surprisingly it fails (“formatting completed with error(s)”) on the following simple statement :
SELECT
`ressources_etudiants`.`codeEtudiant` AS `codeEtudiant`,
`ressources_etudiants`.`nom` AS `nom`,
SUM(`bilan1`.`Fait`) AS `total`
FROM (((((`ressources_etudiants`
JOIN `t_diplomes`
ON ((`ressources_etudiants`.`diplome` = `t_diplomes`.`Diplome`)))
JOIN `ppl`
ON (((`t_diplomes`.`Formation` = `ppl`.`Formation`)
AND (`t_diplomes`.`Semestre actuel` = `ppl`.`Sem`))))
LEFT JOIN `vsum_etud_bilan` `bilan1`
ON (((`ressources_etudiants`.`codeEtudiant` = `bilan1`.`codeEtudiant`)
AND (`bilan1`.`matiere` = `ppl`.`Module`)
AND (`bilan1`.`type` IN ('CM', 'TD', 'TP') )))
) ) )
WHERE ((`ressources_etudiants`.`deleted` = 0)
AND (`ressources_etudiants`.`prenom` = 'etudiant')
AND (`ressources_etudiants`.`commentaire` = 'bilan'))
GROUP BY `ressources_etudiants`.`codeEtudiant`
ORDER BY `ressources_etudiants`.`nom`
there's only ASCII chars, no funny sql syntax or anything. Is there any reason why the formatting fails ?
edit : found the problematic line was
AND (`bilan1`.`type` IN ('CM', 'TD', 'TP') )))
using “in (….)” instead of a simple test here is what causes the error.
Could SQLYog support this, or maybe just resort to parenthesis matching when it fails to understand the enclosed expression ? I don't really need it to understand the details of this line as long as it formats the rest of the statement…