This question is related to:
Another unknown column name error in ON clause
My actual query:
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
I want to get content by section and with category names of this content.
I know that in jos_content table rows with section of id 4 is 8000, but this query returns me arount 177k rows.
I try change INNER JOIN to LEFT etc and use DISTINCT but it won't help
Tables columns:
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
What I want to get is:
jos_content.title (etc) with jos_categories_name of selected section