INNER JOIN is used to return a result table that contains all the rows from two tables where there is a match between the specified keys.
On the MS site the syntax is talk about in relation to the SQL 'FROM' command
SELECT [column_list] FROM first_table INNER JOIN second_table ON first_table.keyfield = second_table.foreign_keyfield;
Everything the 'FROM' is building kind-of-a 'INNER JOIN' table. The 'FROM' command is just some table that the SQL is looking at.
The following example is done using the SQL 2000 Northwind database.
Example Code:
USE Northwind;
SELECT Employees.LastName, Orders.ShipName FROM Employees
INNER JOIN Orders ON Employees.EmployeeID=Orders.EmployeeID;
Using Inner Joins:
An 'INNER JOIN' returns all the columns from both tables. This can be seen by performing a 'SELECT * FROM' on a table. In Access the column that match will have the table name in from of them.
Monday, December 11, 2006
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment