par
Elie » 09 sept. 2010, 01:36
Et biensur après avoir cherché 1h et me résoudre à poster mon problème ici, je trouve la réponse
Voici donc la solution, remplacer
SELECT DISTINCT `tbl_exploitation`.`titre`
FROM `tbl_exploitation` , `tbl_date`
WHERE `tbl_exploitation`.`id_exploitation` = `tbl_date`.`exploitation_id`
ORDER BY `tbl_date`.`prix_vente` + `tbl_date`.`prix_commission` ASC
par
SELECT `tbl_date`.`exploitation_id`, MIN(`tbl_date`.`prix_vente`+`tbl_date`.`prix_commission`) as `total`
FROM `tbl_exploitation`, `tbl_date`
WHERE `tbl_exploitation`.`id_exploitation` = `tbl_date`.`exploitation_id`
GROUP BY `tbl_date`.`exploitation_id`
ORDER BY `total` ASC
Et biensur après avoir cherché 1h et me résoudre à poster mon problème ici, je trouve la réponse :cry:
Voici donc la solution, remplacer
[sql]SELECT DISTINCT `tbl_exploitation`.`titre`
FROM `tbl_exploitation` , `tbl_date`
WHERE `tbl_exploitation`.`id_exploitation` = `tbl_date`.`exploitation_id`
ORDER BY `tbl_date`.`prix_vente` + `tbl_date`.`prix_commission` ASC[/sql]
par
[sql]
SELECT `tbl_date`.`exploitation_id`, MIN(`tbl_date`.`prix_vente`+`tbl_date`.`prix_commission`) as `total`
FROM `tbl_exploitation`, `tbl_date`
WHERE `tbl_exploitation`.`id_exploitation` = `tbl_date`.`exploitation_id`
GROUP BY `tbl_date`.`exploitation_id`
ORDER BY `total` ASC [/sql]