I have three tables -- one contains notes for the day, one contains a list of employees, and one contains a list of employees who have acknowledged reading the notes
I'm having trouble trying to find a way to get the associated acknowledgements for each pass on. Admittedly may be a bit out of my depth so not sure if I'm even approaching this the right way. Any help would be appreciated!
What kind of information would you ideally like to gather?
Here's a sample SQL query that joins 3 tables:
SELECT
student.first_name,
student.last_name,
course.name
FROMstudent
JOINstudent_course
ONstudent.id = student_course.student_id
JOINcourse
ONcourse.id = student_course.course_id;
And here is that query using your tables/columns (note! This may not work as is. I'm not familiar with your exact setup, so it may take some tweaking, but the concept of JOINing and matching id columns should be about the same )
SELECT
p.passon_id, p.employee_id, p.note
e.name,
pa.id
FROMpassons p
JOINemployees e
ON p.employee_id = e.employee_id
JOIN passon_acknowledgements pa
ONpa.passon_id = p.passon_id;
Here's a few external docs that review JOINing multiple tables: