当我在phpmyadmin
使用mariadb
服务器上的mysql上写这行时,a.cpid = b.cid
附近出现意外错误
select a.cid, a.cname as 'cname', b.cname as 'pname'
from categories as a left OUTER JOIN as b ON a.cpid = b.cid
MySQL说:
#1064 - 您的SQL语法有错误;查看与您的MariaDB服务器版本对应的手册,以获得正确的语法,以便在附近使用'作为b ON a.cpid = b.cid LIMIT 0,25'在第1行
答案 0 :(得分:3)
您缺少表名(下面的第二个类别):
select a.cid, a.cname as 'cname', b.cname as 'pname'
from categories as a
left OUTER JOIN categories as b ON a.cpid = b.cid