Mailinglisten-Archive |
Hi, > Benutze z.B. die IF-Fkt: > > select ARTNR, > sum(IF(VGRP = 1,MENGE1,0)) as MGE1_VGRP1, > sum(IF(VGRP = 2,MENGE1,0)) as MGE1_VGRP2, > sum(IF(VGRP = 3,MENGE1,0)) as MGE1_VGRP3, > sum(IF(VGRP = 1,MENGE2,0)) as MGE2_VGRP1, > sum(IF(VGRP = 2,MENGE2,0)) as MGE2_VGRP2, > sum(IF(VGRP = 3,MENGE2,0)) as MGE2_VGRP3 > from F911 where VGRP in (1, 2, 3) > group by ARTNR war zu schnell mit der remail ... es funzt mit select ARTNR, sum(IF(VGRP = 1,MENGE1+MENGE2,0)) as MGE1_VGRP1, sum(IF(VGRP = 2,MENGE1+MENGE2,0)) as MGE1_VGRP2, sum(IF(VGRP = 3,MENGE1+MENGE2,0)) as MGE1_VGRP3, from F911 where VGRP in (1, 2, 3) group by ARTNR Allerbesten Dank nochmal für den Tip ;-)))))) Volker -- Infos zur Mailingliste, zur Teilnahme und zum An- und Abmelden unter -->> http://www.4t2.com/mysql
php::bar PHP Wiki - Listenarchive