Hello,
I am more than astonished. Here is my sql-query I put into an grid-appl.
SELECT
LeistungsartKurz AS Leistung,
SUM(IF(LeistungsartImKursBestanden([idKurs],fkStudierender,idLeistungsart)=0,0,1)) AS BE,
SUM(IF(LeistungsartImKursBestanden([idKurs],fkStudierender,idLeistungsart)=0,1,0)) AS NB
FROM
leistungen,
leistungsarten,
ergebnisse
WHERE
leistungen.fkKurs = [idKurs]
AND
leistungen.idLeistung = ergebnisse.fkLeistung
AND
leistungsarten.idLeistungsart = leistungen.fkLeistungsart
GROUP BY Leistung
the [idKurs] is handed over from the calling application.
The astonishing thing is the following:
with one special [idKurs]-entry the result shown in the grid is correct and identical to the one I get from any mysql-client.
BUT: with any other value for the [idKurs]-variable the values are wrong an different to the one from the mysql-client.
I even changed the variable [idKurs] to a fixed value of say 105. But still the result is wrong.
I wanted to use this to generate a column-plot - but I found the same behavior when I put similar sql to a chart or a grid and used the group-function in there.
Has anyone any idea?
I cost my the whole day today and finally I achieved nothing
Thanks in advance…
Holger