kevinforbes
Programmer
Hi all, I have 2 tables that I want to join based on the following conditions. I always want to display everything from the "courses" table but I only want to join data from the "sessions" table if the session_user_id matches an ASP variable and the "course_code" field in both tables match each other.
The query I came up with looks as follows but doesn't work:
SELECT
courses.course_code, courses.course_name, sessions.core__lesson_status, sessions.core__score
FROM courses
LEFT OUTER JOIN sessions ON sessions.course_code = courses.course_code
WHERE sessions.user_sap_id =10 <--- asp var
thanks for your help,
K
The query I came up with looks as follows but doesn't work:
SELECT
courses.course_code, courses.course_name, sessions.core__lesson_status, sessions.core__score
FROM courses
LEFT OUTER JOIN sessions ON sessions.course_code = courses.course_code
WHERE sessions.user_sap_id =10 <--- asp var
thanks for your help,
K