English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Examples along with the tables which have been used to write the particular queries for outer join and self join?

2006-09-19 14:06:51 · 2 answers · asked by santos_pin 1 in Computers & Internet Software

2 answers

LISTING 3: RIGHT OUTER JOIN Query That Returns Orders With Valid CustomerIDs
SELECT C.FirstName
AS CustomerFirstName,
O.ProductID
FROM dbo.Customer AS C
RIGHT OUTER JOIN dbo.[Order] AS O
ON C.CustomerID = O.CustomerID

LISTING 1: INNER JOIN Query That Returns Customers Who Have Placed Orders
SELECT C.FirstName
AS CustomerFirstName,
O.ProductID
FROM dbo.Customer AS C
INNER JOIN dbo.[Order] AS O
ON C.CustomerID = O.CustomerID

2006-09-19 14:22:42 · answer #1 · answered by runlolarun 4 · 0 0

assuming which you have 2 tables with precisely comparable column, i could advise which you carry out UNION rather of OUTER connect. decide on * from coachs UNION decide on * from gamers; could consequence like what you specify. the alternative could be utilising decide on INTO statements for each table to fill the information into the objective table and do wide-spread question : decide on * from purpose;

2016-12-12 11:25:03 · answer #2 · answered by ? 4 · 0 0

fedest.com, questions and answers