When building a Report, I have a SQL statement that works fine in PHPRunner 5.1. When I download the project and call the report I get a 256 error: duplicate column name original0. Can anyone help me find out where it would be coming from?
This is the SQL statement in PHPRunner 5.1 that works.
SELECT
players.div
,
players.name AS name1,
SUM(picks.totalpts) AS points,
SUM(picks.wins) AS wins,
SUM(picks.losses) AS losses,
SUM(picks.wins)/(SUM(picks.wins)+SUM(picks.losses)) AS pct
FROM players
INNER JOIN picks ON players.name = picks.name
GROUP BY players.name
ORDER BY players.div
, SUM(picks.totalpts) DESC, SUM(picks.wins)
This is the SQL Error statement that comes up after I download the output files:
SELECT original.*, div
as grp0
FROM (SELECT players.div
, players.name AS name1, SUM(picks.totalpts) AS points, SUM(picks.wins) AS wins, SUM(picks.losses) AS losses, SUM(picks.wins)/(SUM(picks.wins)+SUM(picks.losses)) AS pct , players.div
as originalorder1
, SUM(picks.totalpts) as originalorder0
, SUM(picks.wins) as originalorder0
FROM players INNER JOIN picks ON players.name = picks.name GROUP BY players.name ) original WHERE ((div
>= 'Park' AND div
<= 'Side')) ORDER BY div
ASC , originalorder1
ASC, originalorder0
DESC, originalorder0
ASC
Nick