|
|
|
|
Salut,
table sum_art( id, nom ) table sum_cmd( id, id_art, nb ) select a.id, a.nom, sum(c.nb) as nb from sum_art as a left join sum_cmd as c on a.id=c.id_art group by a.id ; Pour les articles sans commande, ça me génére un NULL, mais le programme qui exploite (C++, PHP, ...) transforme en 0. je répète, mais cela fonctionne avec MySQL. A+, crabs ..., I think Slackware sounds better than 'Microsoft,' -- Patrick Volkerding - founder and maintainer of Slackware |