com.alibaba.druid.sql.parser.ParserException: syntax error,expect IS, actual EQ id

Caused by: com.alibaba.druid.sql.parser.ParserException: syntax error, error in :’icle.id = comment.article_id’,expect IS, actual EQ id

解决方法:表的别名前加上as

原sql

   SELECT
            article.id as article_id,
            article.title as article_title,
            article.content as article_content,
            article.author_id as article_author_id,
            comment.id as comment_id,
            comment.content as comment_content,
            comment.date as comment_date
        FROM
            article article
        LEFT  JOIN
            comment comment
        ON
            article.id = comment.article_id

现sql

   SELECT
            article.id as article_id,
            article.title as article_title,
            article.content as article_content,
            article.author_id as article_author_id,
            comment.id as comment_id,
            comment.content as comment_content,
            comment.date as comment_date
        FROM
            article as article
        LEFT  JOIN
            comment as comment
        ON
            article.id = comment.article_id

你可能感兴趣的:(sql)