Different types of joins, DOT NET Programming

What are the different types of joins?

1) INNER JOIN:

The Inner join shows matches only when they exist in both the tables.For example, in the SQL below there are two tables Customers and Orders and the inner join in made on the Customers Customerid and Orders Customerid.Therefore  this SQL will only give you the result with customers who have orders.If the customer does not have order it will not display any record.

SELECT Customers.*, Orders.* FROM Customers INNER JOIN Orders ON

Customers.CustomerID =Orders.CustomerID

2) LEFT OUTER JOIN:

The Left join will display all the records in left table of the SQL statement.In SQL below the customers with or without orders will be displayed. The Order data for customers without orders appears as NULL values. For example, you want to determine the amount ordered by every customer and you need to see who has not ordered anything as well. You can also see the LEFT OUTER JOIN as a mirror image of the RIGHT OUTER JOIN (Is covered in the next part) if you switch the side of each table.

SELECT Customers.*, Orders.* FROM Customers LEFT OUTER JOIN Orders ON

Customers.CustomerID =Orders.CustomerID

3) RIGHT OUTER JOIN :

The Right join will display all records in the right table of the SQL statement. In the below SQL all orders with or without matching customer records will be displayed. The Customer data for orders without customers appears as NULL values. For example, you want to determine if there is any order in the data with undefined CustomerID values (say, after a conversion Or something like it). You can also see the RIGHT OUTER JOIN as a mirror image of the LEFT OUTER JOIN if you switch the side of every table.

SELECT Customers.*, Orders.* FROM Customers RIGHT OUTER JOIN Orders ON Customers.CustomerID =Orders.CustomerID

Posted Date: 9/24/2012 4:32:58 AM | Location : United States







Related Discussions:- Different types of joins, Assignment Help, Ask Question on Different types of joins, Get Answer, Expert's Help, Different types of joins Discussions

Write discussion on Different types of joins
Your posts are moderated
Related Questions
What is a cloud? A cloud is a combination of hardware, storage, networks, services, and interfaces that helps in delivering computing as a service. It has generally three users

Question: (a) List three advantages of binding data to controls. (b) The Repeater control uses templates to control formatting. Define the five types of templates supporte

Why do we need static methods for Post Cache substitution? The ASP.NET should be able to call this static method even when there isn't an instance of your page class available.

MAT LAB programming Project Description: i have simulation and i need to simulate the equation in ,and test the all simulation it working with your work program other code sh

I am looking individuals who have industry experience working on Microsoft Technology and Jquery ( MVC 4.5 ), who will take live online session and give training through Team Viewe

im retrieving the path of image from the database i want to get the image in that path to be displayed in my datagridviewvolumn

IT governance defined In this section, a short literature survey will be conducted. The results will be presented in a final comparative table. Before starting defining IT gove

What is the difference between Stored Procedure (SP) and User Defined Function (UDF)? Some of major differences between a stored procedure and user defined are as follows:-

Project Description: We need to construct services in C# or VB.NET that can manipulate with a Targin TIP Protocol Server (protocol for financial information exchange), receive d

Briefly explain how the server control validation controls work? A validation control works by evaluating the value of an input server control on the page to see whether it mee