Thank you Ray for your reply, but unfortunately your proposal does not work. I get an SQL error.

But now it seems that I found the solution on the results page where the problem was:

SELECT (CAST(AVG(`kat1Betyg`+`kat2Betyg`+`kat3Betyg`+`kat4Betyg`+`kat5Betyg`+`kat6Betyg`+`kat7Betyg`+`kat8Betyg`) /8 AS DECIMAL(10,1))) AS average, `id`,`bild`,`laromedelsnamn`,`arskurser` FROM laromedel GROUP BY `id`

...and on the details page, I managed to group the two querys to one:

SELECT(CAST(AVG(laromedel.kat1Betyg + laromedel.kat2Betyg + laromedel.kat3Betyg + laromedel.kat4Betyg + laromedel.kat5Betyg + laromedel.kat6Betyg + laromedel.kat7Betyg + laromedel.kat8Betyg) /8 AS DECIMAL(10,1))) AS average, laromedel.id, laromedel.laromedelsnamn, laromedel.bild, laromedel.arskurser, laromedel.utvecklare, laromedel.pris, laromedel.adaptivt, laromedel.heltackande, laromedel.testad, laromedel.kat1Betyg, laromedel.kat1Kommentar, laromedel.kat2Betyg, laromedel.kat2Kommentar, laromedel.kat3Betyg, laromedel.kat3Kommentar, laromedel.kat4Betyg, laromedel.kat4Kommentar, laromedel.kat5Betyg, laromedel.kat5Kommentar, laromedel.kat6Betyg, laromedel.kat6Kommentar, laromedel.kat7Betyg, laromedel.kat7Kommentar, laromedel.kat8Betyg, laromedel.kat8Kommentar, former.`text` AS former_text, avsettfor.`text` AS avsettfor_text FROM laromedel LEFT OUTER JOIN former ON laromedel.form_id = former.id LEFT OUTER JOIN avsettfor ON laromedel.avsettfor_id = avsettfor.id WHERE laromedel.id = ?