这个问题与:
我的实际查询:
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
, jc.title AS category
FROM jos_content AS c
INNER JOIN jos_categories AS jc
ON c.sectionid = jc.section
WHERE c.sectionid = 4
我想按部分和该内容的类别名称获取内容。
我知道在 jos_content 表中,id 为 4 部分的行是 8000,但是这个查询返回我大约 177k 行。
我尝试将 INNER JOIN 更改为 LEFT 等并使用 DISTINCT 但它无济于事
表格列:
jos_content:
id, title, introtext, state, created, created_by etc
jos_categories:
id, section (id of sections, names doesn't naming convention IMO, its Joomla 1.5 db BTW), title
jos_sections:
id, title
我想要得到的是:
jos_content.title (etc) 和所选部分的 jos_categories_name