27-05-2009, 12:02 PM
Voici un exemple:
A priori, je vois pas trop comment je pourrais faire mieux ^^'
Code :
SELECT SUM(u.power*b.number) as numb, b.state
FROM battalion_tbl b
LEFT JOIN player_tbl as pi
ON pi.id = b.player
LEFT JOIN unities_tbl as u
ON pi.nation = u.nation AND u.pattern = b.pattern
WHERE b.state != 'HER' AND pi.coalition = 'lumiere'
GROUP BY b.state
HAVING numb > 0
A priori, je vois pas trop comment je pourrais faire mieux ^^'