执行内部联接时mysql的语法错误

时间:2014-04-23 22:00:19

标签: mysql sql syntax-error

 SELECT t1.Type,
    FROM PERFORMS_SURGERY AS PS
    INNER JOIN
 (SELECT CPT, Type FROM SURGERY) as t1
ON t1.CPT = PS.CPT
    WHERE PS.PUsername = "klove30"

我在“FROM PERFORMS_SURGERY AS PS”中收到语法错误         内部联接 (SELECT CPT,Type FROM SURGERY)“。语法错误是什么?

1 个答案:

答案 0 :(得分:1)

SELECT t1.Type,
    FROM ...

在选择列表的最后一列之后不应该有逗号。

将其更改为:

SELECT t1.Type
    FROM ...