Pujan Patel Pujan Patel - 16 days ago 7
SQL Question

Convert to sql without INNER JOIN

How can I make this query using multiple tables without using

INNER JOIN
?

SELECT
tCourse.CourseNumber,
tTerms.Term,
tTerms.SemesterID
FROM
tCourse
INNER JOIN
tTerms ON tCourse.CourseID = tTerms.CourseID;

Answer

I wouldn't recommend this but the equivalent implicit join syntax to the explicit syntax you wrote would be:

SELECT 
    tCourse.CourseNumber,
    tTerms.Term,
    tTerms.SemesterID
FROM 
    tCourse, tTerms
WHERE
    tCourse.CourseID = tTerms.CourseID;

So Table1, Table2

Then move the ON condition to a WHERE clause

To expand a little for the peanut gallery. Again this is not the recommended way of doing a join. Implicit syntax leads to confusion especially when someone else starts debugging your code, plus implicit joins have more limitations than explicit joins depending on the platform you are working on. To take Marc's link here is an article on why not to use implicit join. http://sqlblog.com/blogs/aaron_bertrand/archive/2009/10/08/bad-habits-to-kick-using-old-style-joins.aspx

My goal is to show you because it seems like you want to be able to write the query without using INNER JOIN that it can be done but to discourage you from doing it. I believe one is empowered by knowledge of what are the right and wrong ways of doing things.