How to write Query to Join Two Tables

The first thing you need to know common key for both tables. That means common fields of both the tables on which you are going to join. If you know table structure of both the tables, it is very easy to find Key field, and you can write join SQL query easily.


FROM   Customer_Table a
        Order_Table b
Using (Customer_Number) ;

You can find inner vs outer join differences and which is better.

I used here two tables. One is customer_table and the other one is order_table. So, if you know the key field you can easily complete your query.

Key is: using(customer_number),

The column in the using is common to both the tables. Now you can write any join query quickly.

Related Posts

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.