navicat12 使用left join 提示语法错误

img

想要查询导出表名 表注释 字段名 字段注释
使用left join语句一直提示语法错误;
用另外一种方法能成功查询,速度较慢。

img

请问我使用的left join哪里有问题吗? 还有更快的查询方法吗?



```sql
SELECT
    t.table_name ,
    t.table_comment ,
    c.column_name ,
    c.column_type ,
    c.column_comment ,
    
FROM
    information_schema.TABLES t LEFT JOIN information_schema.COLUMNS c ON t.table_name = c.table_name
        and t.table_schema = c.table_schema
WHERE
    t.table_schema = '数据库名称' 
ORDER BY
t.table_name;

```

c.column_comment , 这个后面多了个逗号

错误信息已经提示了,在from附近有错误,第6行c.column_comment 后面多个逗号

最后查询字段不加逗号

img

img


逗号去掉