Salut !
mon 1er code
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11 from tb_process inner join tb_step on (tb_process.code_step = tb_step.code_step) inner join tb_energie on (tb_step.code_step = tb_energie.code_step) inner join tb_unite on (tb_step.code_unite = tb_unite.code_unite) and (tb_process.date_bilan = tb_energie.date_mois) where ( ((tb_process.date_bilan between :date_debut and :date_fin) and (tb_energie.date_mois between :date_debut and :date_fin)) )
mon 2ème code
dans le 1er code la condition
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10 from tb_process inner join tb_step on (tb_process.code_step = tb_step.code_step) inner join tb_energie on (tb_step.code_step = tb_energie.code_step) inner join tb_unite on (tb_step.code_unite = tb_unite.code_unite) where ( ( (tb_process.date_bilan = tb_energie.date_mois) and (tb_process.date_bilan between :date_debut and :date_fin) and (tb_energie.date_mois between :date_debut and :date_fin)) )est dans les jointures mais dans le second elle est dans la clause where.tb_process.date_bilan = tb_energie.date_mois
Le résultat obtenu est le même mais d'après vous quel est le code le plus optimisé point de vue rapidité puisque ma base de données est distante.
Merci par avance.
Partager