Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • SQL Joins

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 283
    Comment on it

    Joins

    Joins in SQL are nothing but a technique to join the two table based on a common field.

    1. OrderID CustomerID OrderDate
    2. 10308 2 1996-09-18
    3. 10309 37 1996-09-19
    4. 10310 77 1996-09-20
    5.  
    6. CustomerID CustomerName ContactName Country
    7. 1 Alfreds Futterkiste Maria Anders Germany
    8. 2 Ana Trujillo Ana Trujillo Mexico
    9. 3 Antonio Moreno Antonio Moreno Mexico

    There are two tables

    To join

    1. SELECT Orders.OrderID, Customers.CustomerName, Orders.OrderDate
    2. FROM Orders
    3. INNER JOIN Customers
    4. ON Orders.CustomerID=Customers.CustomerID;

    Then it shows this.

    1. OrderID CustomerName OrderDate
    2. 10308 Ana Trujillo 9/18/1996
    3. 10365 Antonio Moreno 11/27/1996
    4. 10383 Around the Horn 12/16/1996
    5. 10355 Around the Horn 11/15/1996
    6. 10278 Berglunds snabbkp 8/12/1996

    This can be result.

    The join are of three types.

    1.Inner join

    2.Outer join

    3.Self join

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Reset Password
Fill out the form below and reset your password: