Mailinglisten-Archive |
Hallo Volker, > -----Original Message----- > From: volker.wambach [mailto:volker.wambach at mako.de] > select ARTNR, sum(VGRP = 1), sum(VGRP = 2), sum(VGRP = 3) > from F911 where VGRP in (1, 2, 3) > group by ARTNR > 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 (ungetestet) Gruss, Michael Donning -- Infos zur Mailingliste, zur Teilnahme und zum An- und Abmelden unter -->> http://www.4t2.com/mysql
php::bar PHP Wiki - Listenarchive