안녕하세요는 다음과 같이 두 테이블을 가지고 왼쪽 MySQL의 문제에 가입
내가 원하는 것은 MySQL은 다음과 같습니다, 카테고리와 카테고리의 섹션 제목을 얻을되는
,SELECT `categories`.`category_id`,
`categories`.`category_title`,
`categories`.`category_created`,
`section`.`section_id`,
`section`.`section_title`,
`categories`.`parent_section`
FROM (`categories`)
LEFT JOIN `section`
ON `section`.`section_id` = `categories`.`category_id`
그러나 모두 내가 돌아 오는 것은 카테고리 목록과 섹션 목록이 아니라 상위 섹션입니다. 내가 잘못 했니?
난 당신 ON 가입하는 의미 내기 'section'.'section_id' ='categories'.parent_section_id' – Andrew
아! 그것은 어리석은 무엇을 알 것입니다! – Udders
parent_section이란 자체 참조 란 무엇입니까? 'categories'는 나무입니까? 이 경우 부모를 가져 오기위한 귀하의 요구 사항은 무엇입니까? –