Q

Difference between select query and JOIN

What is the difference between a query like select a.field1,b.feild2 from Table1 a,Table2 b where a.id=b.fk_code and using JOIN?

What is the difference between a query like select a.field1,b.feild2 from Table1 a,Table2 b where a.id=b.fk_code and using JOIN?
In Oracle, I can write a query similar to the following:
SELECT a.field1, b.field2
FROM table1 a, table2 b
WHERE a.id=b.fk_code;
The above will join two tables together on the defined join condition (the WHERE clause). One of the criticisms of Oracle was that the join syntax above is not compliant with the widely accepted ANSI SQL standard syntax. An ANSI-compliant join statement similar to the above will look like the following:
SELECT a.field1, b.field2
FROM table1 a INNER JOIN table2 b
     ON a.id=b.fk_code;
The two statements will return identical results. A developer who creates applications for Oracle and other ANSI-compliant database platforms can now use the same syntax in each. ANSI-compliant joins were first available in Oracle 9i.
This was first published in February 2007

Dig deeper on Oracle and SQL

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide

SearchDataCenter

SearchContentManagement

SearchFinancialApplications

Close