Habe nach der Installation folgende Fehlermeldung:
SQL Error : 1054 Unknown column 'ts.heim' in 'on clause'
SQL Statement:
Code: Alles auswählen
SELECT ts.heim, (
sum( bewertet ) + auspunkte
) AS punkte, Siege AS Sieg, (
Siege / ( Siege + Unentschieden + Niederlage ) *100
) AS Siegepro, Unentschieden, (
Unentschieden / ( Siege + Unentschieden + Niederlage ) *100
) AS Unentschiedenpro, Niederlage, (
Niederlage / ( Siege + Unentschieden + Niederlage ) *100
) AS Niederlagepro, (
Siege + Unentschieden + Niederlage
) AS Spieletipps
FROM tippspiel_spieltage ts, tippspiel_usertips ut
LEFT JOIN phpbb_users u ON ut.userid = u.user_id, (
SELECT ts.auswarts, sum( bewertet ) AS auspunkte
FROM tippspiel_spieltage ts, tippspiel_usertips ut
LEFT JOIN phpbb_users u ON ut.userid = u.user_id
WHERE ut.spielid = ts.spielid
AND ut.userid = '3'
AND ut.tabelle =1
GROUP BY ts.auswarts
)hilfe
LEFT JOIN (
SELECT name AS team, ( 0 + fuer2 ) AS Siege
FROM tippspiel_tabelle, (
SELECT name AS auswarts, 0 AS fuer2
FROM tippspiel_tabelle
WHERE name NOT
IN (
SELECT ts.auswarts AS team
FROM tippspiel_usertips ut
LEFT JOIN tippspiel_spieltage ts ON ut.spielid = ts.spielid
WHERE (
auswartstipp - heimtipp
) >0
AND ut.userid = '3'
AND ut.tabelle =1
GROUP BY ts.auswarts
)
UNION SELECT ts.auswarts AS team, (
count( auswartstipp - heimtipp )
) AS fuer2
FROM tippspiel_usertips ut
LEFT JOIN tippspiel_spieltage ts ON ut.spielid = ts.spielid
WHERE (
auswartstipp - heimtipp
) >0
AND ut.userid = '3'
AND ut.tabelle =1
GROUP BY ts.auswarts
)hilfe
WHERE name NOT
IN (
SELECT ts.heim AS team
FROM tippspiel_usertips ut
LEFT JOIN tippspiel_spieltage ts ON ut.spielid = ts.spielid
WHERE (
heimtipp - auswartstipp
) >0
AND ut.userid = '3'
AND ut.tabelle =1
GROUP BY ts.heim
)
AND name = hilfe.auswarts
UNION SELECT ts.heim AS team, (
(
count( heimtipp - auswartstipp )
) + fuer2
) AS Niderlage
FROM tippspiel_usertips ut
LEFT JOIN tippspiel_spieltage ts ON ut.spielid = ts.spielid, (
SELECT name AS auswarts, 0 AS fuer2
FROM tippspiel_tabelle
WHERE name NOT
IN (
SELECT ts.auswarts AS team
FROM tippspiel_usertips ut
LEFT JOIN tippspiel_spieltage ts ON ut.spielid = ts.spielid
WHERE (
auswartstipp - heimtipp
) >0
AND ut.userid = '3'
AND ut.tabelle =1
GROUP BY ts.auswarts
)
UNION SELECT ts.auswarts AS team, (
count( auswartstipp - heimtipp )
) AS fuer2
FROM tippspiel_usertips ut
LEFT JOIN tippspiel_spieltage ts ON ut.spielid = ts.spielid
WHERE (
auswartstipp - heimtipp
) >0
AND ut.userid = '3'
AND ut.tabelle =1
GROUP BY ts.auswarts
)hilfe
WHERE (
heimtipp - auswartstipp
) >0
AND ut.userid = '3'
AND ts.heim = hilfe.auswarts
AND ut.tabelle =1
GROUP BY team
)Siege ON ts.heim = Siege.team
LEFT JOIN (
SELECT name AS team, ( 0 + fuer2 ) AS Unentschieden
FROM tippspiel_tabelle, (
SELECT name AS auswarts, 0 AS fuer2
FROM tippspiel_tabelle
WHERE name NOT
IN (
SELECT ts.auswarts AS team
FROM tippspiel_usertips ut
LEFT JOIN tippspiel_spieltage ts ON ut.spielid = ts.spielid
WHERE (
auswartstipp - heimtipp
) =0
AND ut.userid = '3'
AND ut.tabelle =1
GROUP BY ts.auswarts
)
UNION SELECT ts.auswarts AS team, (
count( auswartstipp - heimtipp )
) AS fuer2
FROM tippspiel_usertips ut
LEFT JOIN tippspiel_spieltage ts ON ut.spielid = ts.spielid
WHERE (
auswartstipp - heimtipp
) =0
AND ut.userid = '3'
AND ut.tabelle =1
GROUP BY ts.auswarts
)hilfe
WHERE name NOT
IN (
SELECT ts.heim AS team
FROM tippspiel_usertips ut
LEFT JOIN tippspiel_spieltage ts ON ut.spielid = ts.spielid
WHERE (
heimtipp - auswartstipp
) =0
AND ut.userid = '3'
AND ut.tabelle =1
GROUP BY ts.heim
)
AND name = hilfe.auswarts
UNION SELECT ts.heim AS team, (
(
count( heimtipp - auswartstipp )
) + fuer2
) AS Niderlage
FROM tippspiel_usertips ut
LEFT JOIN tippspiel_spieltage ts ON ut.spielid = ts.spielid, (
SELECT name AS auswarts, 0 AS fuer2
FROM tippspiel_tabelle
WHERE name NOT
IN (
SELECT ts.auswarts AS team
FROM tippspiel_usertips ut
LEFT JOIN tippspiel_spieltage ts ON ut.spielid = ts.spielid
WHERE (
auswartstipp - heimtipp
) =0
AND ut.userid = '3'
AND ut.tabelle =1
GROUP BY ts.auswarts
)
UNION SELECT ts.auswarts AS team, (
count( auswartstipp - heimtipp )
) AS fuer2
FROM tippspiel_usertips ut
LEFT JOIN tippspiel_spieltage ts ON ut.spielid = ts.spielid
WHERE (
auswartstipp - heimtipp
) =0
AND ut.userid = '3'
AND ut.tabelle =1
GROUP BY ts.auswarts
)hilfe
WHERE (
heimtipp - auswartstipp
) =0
AND ut.userid = '3'
AND ts.heim = hilfe.auswarts
AND ut.tabelle =1
GROUP BY team
)Unentschieden ON ts.heim = Unentschieden.team
LEFT JOIN (
SELECT name AS team, ( 0 + fuer2 ) AS Niederlage
FROM tippspiel_tabelle, (
SELECT name AS auswarts, 0 AS fuer2
FROM tippspiel_tabelle
WHERE name NOT
IN (
SELECT ts.auswarts AS team
FROM tippspiel_usertips ut
LEFT JOIN tippspiel_spieltage ts ON ut.spielid = ts.spielid
WHERE (
auswartstipp - heimtipp
) <0
AND ut.userid = '3'
AND ut.tabelle =1
GROUP BY ts.auswarts
)
UNION SELECT ts.auswarts AS team, (
count( auswartstipp - heimtipp )
) AS fuer2
FROM tippspiel_usertips ut
LEFT JOIN tippspiel_spieltage ts ON ut.spielid = ts.spielid
WHERE (
auswartstipp - heimtipp
) <0
AND ut.userid = '3'
AND ut.tabelle =1
GROUP BY ts.auswarts
)hilfe
WHERE name NOT
IN (
SELECT ts.heim AS team
FROM tippspiel_usertips ut
LEFT JOIN tippspiel_spieltage ts ON ut.spielid = ts.spielid
WHERE (
heimtipp - auswartstipp
) <0
AND ut.userid = '3'
AND ut.tabelle =1
GROUP BY ts.heim
)
AND name = hilfe.auswarts
UNION SELECT ts.heim AS team, (
(
count( heimtipp - auswartstipp )
) + fuer2
) AS Niderlage
FROM tippspiel_usertips ut
LEFT JOIN tippspiel_spieltage ts ON ut.spielid = ts.spielid, (
SELECT name AS auswarts, 0 AS fuer2
FROM tippspiel_tabelle
WHERE name NOT
IN (
SELECT ts.auswarts AS team
FROM tippspiel_usertips ut
LEFT JOIN tippspiel_spieltage ts ON ut.spielid = ts.spielid
WHERE (
auswartstipp - heimtipp
) <0
AND ut.userid = '3'
AND ut.tabelle =1
GROUP BY ts.auswarts
)
UNION SELECT ts.auswarts AS team, (
count( auswartstipp - heimtipp )
) AS fuer2
FROM tippspiel_usertips ut
LEFT JOIN tippspiel_spieltage ts ON ut.spielid = ts.spielid
WHERE (
auswartstipp - heimtipp
) <0
AND ut.userid = '3'
AND ut.tabelle =1
GROUP BY ts.auswarts
)hilfe
WHERE (
heimtipp - auswartstipp
) <0
AND ut.userid = '3'
AND ts.heim = hilfe.auswarts
AND ut.tabelle =1
GROUP BY team
)Niederlage ON ts.heim = Niederlage.team
WHERE ut.spielid = ts.spielid
AND hilfe.auswarts = ts.heim
AND ut.userid = '3'
AND ut.tabelle =1
GROUP BY ts.heim
ORDER BY punkte DESC
LIMIT 0 , 30
Line : 1354
File : userstatistik.php
Wer hat eine Idee? Ich habe mySQL 5.0.21 installiert!