Answered Questions

  • Explain the different types of joins

    Star Read Best Answer

    Editorial / Best Answer

    krishna420  

    • Member Since Jul-2008 | Jul 23rd, 2008


    There are 5 types of joins available in sql server

    1) inner join
    2) outer join( left outer join,Right outer join)
    3) Full Join
    4) Cross Join
    5) Self Join

    1) inner Join : Two tables having the common column values go with inner join.

    Example:
    select * from emp inner join empsalary
    on
    emp.empid=empsalary.empid

    2) outer join:
    Outer join has two sub types left outer join,Right outer join
    Left outer join: Taking Left side values of the table checking into right side
    select * from emp left outer join empsalary
    on emp.empid=empsalary.empid
    Right Outer join:Taking Right side values of the table checking left side
    select * from emp right outer join empsalary
    on emp.empid=empsalary.empid

    3) Full join :
    Full join is combined with left outer join ,Right outer join.
    select * from emp full join employee
    on emp.empid=employee.empid

    4) cross Join: cross join is an carteasion product ,its like matrix format here it wont come on condidtion

    select * from emp cross join employee

    Self join :

    Self join can check within the table called self join.

    zunaid

    • Oct 12th, 2012

    Different types of joins

    Natural join
    Inner join
    outer join
    cross join
    equi join
    non equi join
    self join

    vamsi krishna devineni

    • Nov 27th, 2011

    Mainly we uses some joins in the real time environment.. that is 1) Inner join 2) left outer join 3) right outer join 4) full outer join 5) cross join i will explain in easy way so that u can underst...