SQL Inner Equi Join Examples

by top54u.com 24 Feb, 2008
Spotlight.....

Inner join is a default type of SQL Join that return the records matching in all the tables joined in sql query satisfying the condition specified in WHERE clause.

 

Inner join includes 3 types of joins similar to one another.

 

Self Join: Self join joins a single sql database table to itself. You can see the example of self join here … Self Join In Sql Server 2000 2005

 

Equi Join: Equi Join returns all the columns from both tables and filters the records satisfying the matching condition specified in Join “ON” statement of sql inner join query.

 

SQL Inner Equi Join Example:

 

USE NORTHWIND

SELECT * FROM CATEGORIES C INNER JOIN
PRODUCTS P ON P.CATEGORYID = C.CATEGORYID

 


Result will display the following columns:

CategoryID, CategoryName, Description, Picture, ProductID, ProductName, SupplierID, CategoryID, QuantityPerUnit, UnitPrice, UnitsInStock, UnitsOnOrder, ReorderLevel, Discontinued

 

Above equi join sql query will display the categoryId two times in a row because both the tables have categoryId column. You can convert the result into natural join by elimination the identical columns and unnecessary columns.

 

Click here to learn how to specify the column names in natural join sql query.

Spotlight.....

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , , , ,

Add comment


(Will show your Gravatar icon)  

  Country flag

[b][/b] - [i][/i] - [u][/u]- [quote][/quote]



Live preview

8/23/2008 9:08:45 PM

OUR SPONSORS[+ advertise here]
related videos.....
recent posts.....
top54u ezines.....