Is there any difference between
SELECT *
FROM TABLE_A a
JOIN TABLE_B b
ON a.propertyA = b.propertyA
And the query
SELECT * from TABLE_A a, TABLE_B b where a.propertyA=b.propertyA.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
INNER JOINis ANSI (SQL-92) syntax which you use on the first one. It is generally considered more readable, especially when you join lots of tables.The
WHERE syntax(SQL-89) is more relational model oriented. A result of two tables JOIN’ed is a cartesian product of the tables to which a filter is applied which selects only those rows with joining columns matching.It’s easier to see this with the WHERE syntax.
I’d rather go on the
ANSItype join because if you some how omit theONclause, an error is generated whereas the old type of join if you omit the condition onwhereclause will not produce an error message and thus it will generate cartesian product.