Hello,
I have a table which is working fine so far. The code is:
{arijtablesorter defaultSorting="4:ASC" sorting="TRUE" notSortableCols="0,1,2,3"}
{arisqltable}
{arisqltablequery}
SELECT spieler AS "Spieler"
,pins AS "Pins"
,spiele AS "Spiele"
,(pins/spiele) AS "Schnitt"
,platz AS "Platz"
FROM fab_ergebnisse
{/arisqltablequery}
{/arisqltable}
{/arijtablesorter}
Now I need two things:
1. I need to GROUP BY spieler
But when I change the code like this
{arijtablesorter defaultSorting="4:ASC" sorting="TRUE" notSortableCols="0,1,2,3"}
{arisqltable}
{arisqltablequery}
SELECT spieler AS "Spieler"
,sum(pins) AS "Pins"
,sum(spiele) AS "Spiele"
,(sum(pins)/sum(spiele)) AS "Schnitt"
,platz AS "Platz"
FROM fab_ergebnisse
GROUP BY spieler
{/arisqltablequery}
{/arisqltable}
{/arijtablesorter}
there is no output in the frontend anymore.
2. I need to get data from a second database within this query. But when I change it like this
{arijtablesorter defaultSorting="4:ASC" sorting="TRUE" notSortableCols="0,1,2,3"}
{arisqltable}
{arisqltablequery}
SELECT name AS "Spieler"
,pins AS "Pins"
,spiele AS "Spiele"
,(pins/spiele) AS "Schnitt"
,platz AS "Platz"
FROM fab_ergebnisse
INNER JOIN jos_users ON id=spieler
{/arisqltablequery}
{/arisqltable}
{/arijtablesorter}
there is no output in the frontend anymore.
I also tried it in different ways (From fab_ergebnisse as "FE"....) but it didn't work, too.
Can somebody help me?
Thank you in advance
clioschrotter
|