I feel like the database manager isn’t recognising my tables properly - or I’m doing it wrong.
Please help!
I want to do a simple query, that has a few joins.
This is the working raw query (using Beekeeper studio as db manager):
SELECT ccc.course_id AS course_id, cccl.course_chapter_id AS chapter_id, cl.id AS lecture_id
FROM courses_lectures cl
JOIN courses_chapters_courses_lectures cccl ON (cccl.course_lecture_id = cl.id)
JOIN courses_chapters_courses ccc ON (ccc.course_chapter_id = cccl.course_chapter_id)
This is the output:
Now trying to recreate this in wappler:
This is the way my tables are connected:
-
courses
containscourses_chapters
containscourses_lectures
. -
courses
is connected with a ‘join’ table tocourses_chapters
, the name of this ‘join table’ iscourses_chapters_courses
. -
courses_chapters
is connected with a ‘join’ table tocourses_lectures
, the name of this ‘join table’ iscourses_chapters_courses_lectures
.
This is how I am trying to get to this data using the query builder:
Attempt 1. bottom up
- Add
courses_lectures
- Try to join with
courses_chapters_courses_lectures
- Can’t… join, that table is not available to pick.
Attempt 2. top down
-
Add
courses
:
-
Add
courses_chapters_courses
to join with
sidenote: it didn’t automatically do the correct join here -
Add
courses_chaptres
to join with
sidenote: it DID automatically join correctly here
-
Try to join with
courses_chapters_courses_lectures
:
-
Can’t… join, that table is not available to pick.
Any ideas?