AS附近的mySQL错误

时间:2014-06-27 17:21:29

标签: mysql sql

任何人都可以帮忙吗?我刚刚切换了网络服务器,我测试一切正常,但我看到了这个错误。任何想法都有错误的查询?它似乎在我的上一个主机上有效

Critical Error
        A database error has occoured.
        Error Returned mySQL query error: SELECT f.* AS fixtures,
                    team1.teamName AS HomeTeam,
                    team1.tid AS HomeTeamID,
                    team2.teamName AS AwayTeam,
                    team2.tid AS AwayTeamID,
       GROUP_CONCAT(n.extra separator ',') AS scorers,
       GROUP_CONCAT(n.homeEvent separator ',') AS homeEvent,
       GROUP_CONCAT(n.eventType separator ',') AS eventType
    FROM fixtures f
    LEFT JOIN notifications n ON n.fixtureID = f.fid
    LEFT JOIN teams team1 ON team1.tid = f.HomeTeam
    LEFT JOIN teams team2 ON team2.tid = f.AwayTeam
    WHERE f.kickoff > 1403823600 AND f.lid=1
    GROUP BY f.fid
    ORDER BY n.time ASC, f.kickoff ASC

mySQL错误:

  

您的SQL语法有错误;查看与您的MySQL服务器版本相对应的手册,以获得正确的语法,以便在附近的AS固定装置上使用,                           team1.teamName AS HomeTeam,                           team1.tid AS HomeTeamID,                       '在第1行

2 个答案:

答案 0 :(得分:3)

你不能像这样投射一张通配符。仅适用于单个字段

SELECT f.* AS fixtures

尝试类似

的内容
SELECT f.fixtures AS fixtures, f.field AS field

答案 1 :(得分:2)

我不知道你在之前的网络服务器上运行了什么样的sql引擎,但实际上这是不允许的:

SELECT f.* AS fixtures

您需要指定一个列,不能使用通配符进行转换。