Selection of 2 peak-values and a fixed column

2007-12-11 Thread Volker Duetsch
Hi, select mnr, kw, sum(pzt), sum(uu), sum(u01), sum(u02), sum(u03) from mde where mnr=63210 group by kw, mnr results in: mnr kw sum(pzt)sum(uu) sum(u01)sum(u02)sum(u03) 63210 02 773850 131 0

Transpose / Crosstab

2007-12-10 Thread Volker Duetsch
Hello, I've found some documentation on transposing tables, generating crosstabs (e.g. http://dev.mysql.com/tech-resources/articles/wizard/print_version.html). To be honest I've to admit that I tried to figure out how it works, but I'm not able to adopt it to my problem. My starting table looks