Apuntes
Note FOR JOINS
Contenido del apunte (2)
Página 1
INNER VS OUTER JOIN
WE have to tables " Product table " And "Category Table"
We want To make Joins Between Them
But Their Is many Diffrents ways To join :
JOIN
RIGHT OUTER JOIN
LEFT OUTER JOIN
-------
AS you see prd and cty in the of each line that we did it just f the next we do need to type all the line on commande so prd is a shortcut for AdventureWorks2014.SimpleOrders.Product



"THE JOIN IS A INNER JOIN" AS you see prd and cty in the of each line that we did it just f the next we do need to type all the line on commande so prd is a shortcut for AdventureWorks2014.SimpleOrders.Product And cty is a shortcut for AdventureWorks2014.SimpleOrders.Category
So we just Display a list of the product and theire respective category
But if we want to display all category we need to diplay all from right or left Side
Let's see RIGHT OUTER JOIN
AS You see we force to display all rows in Category NAME


Let's See For Left OUTER JOIN

SELF JOIN
We have category and the parent category
So we want to joint Category With Parent category
USING "cty.parent.category=pty.category"
N.B --- TO get ALL GAtogreys EVEN WITHOUT A Parent Outer Join IS needed


Página 2
Información
- Descripción
- 6 (USING JOINS In a SELECT STATEMENTS) DPI Apunte sobre Note FOR JOINS, creado por Mahdaoui Mostafa el 28/03/2016.
- Creado por
- Mahdaoui Mostafa · mar 2016
- Actualizado
- 3 abr 2016
- Visitas
- 0
- Valoración