SELECT DISTINCT course.course_no, description
    FROM course, section
    WHERE location = 'L210'
    ORDER BY course_no

Here is the problem: Give me a list of courses (by course_no and description) that are taught in room L210

But now find out I need to use the JOIN...ON... syntax
Need help redoing that with the above statement I started...Any takers?

Recommended Answers

All 2 Replies

It would help if we knew the structure of the tables (or the key they share).
Anyway, your syntax will create a cartesian product, as you haven't set any criteria for the join you are performing (you are performing a join, but with the old syntax and without the on.. part)

So, you would right it as:

select distinct course.course_no, description 
from course inner /*(or left or right or cross or full) */ join section 
on course.field = section.field --you need to change the field appropriately 
where location = 'L210' 
order by course_no 

thank you adam! appreciate your reply and help

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.