0

询问:

SELECT  c.title AS title
            , c.introtext AS body
            , c.state AS state
            , c.created AS created
            , c.created_by AS uid
            , c.modified AS modified
            , c.modified_by AS modified_uid
            , c.published AS published
            , c.published_by AS published_uid
            , jos_categories.title AS category
FROM
          jos_content AS c, jos_categories
INNER JOIN jos_categories AS jc
ON c.sectionid = jc.section
WHERE c.sectionid = 7

我确定 sectionid 列存在,但出现错误:

错误代码:1054。“on 子句”中的未知列“c.sectionid”0.000 秒

我看到了这个主题:ON 子句中的 MySQL 未知列,但我也无法解决。

4

2 回答 2

1

将您的 FROM 子句更改为:

FROM   jos_content AS c
INNER JOIN jos_categories AS jc 
ON c.sectionid = jc.section 
WHERE c.sectionid = 7 
于 2012-08-11T07:32:05.897 回答
0

您执行和之间的jos_categories连接jos_categories AS jc

jos_content AS c, jos_categories
INNER JOIN jos_categories AS jc
ON c.sectionid = jc.section

但是cjos_content...

于 2012-08-11T07:23:20.327 回答