Hi Dudes
Can any one tell how can i use natural join in sql server 2005
Natural Join
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Jiteendra SampathiraoRank #585 · 4.1K reputationPosted Jul 26, 2011, 3:42 AM EDT
natural joins are not available in Sql server 2005...
refer
For Sql joins Click Here
hope it help you.......
Blocked AccountRank #403 · 6.2K reputationPosted Jul 26, 2011, 3:41 AM EDT
There is no Natural Join available in Sql Server.
Zoran HorvatRank #792 · 2.9K reputationPosted Jul 26, 2011, 3:43 AM EDT
CREATE TABLE Position (
PositionID INT PRIMARY KEY IDENTITY(1, 1),
Name VARCHAR(100)
);
CREATE TABLE Employee (
EmployeeID INT PRIMARY KEY IDENTITY(1, 1),
PositionID INT,
Name VARCHAR(100)
);
Natural join in this case would join Name columns in Position and Employee tables as well, but that would be wrong, because those columns specify distinct properties of the position and employee in the database. Correct (manually formed) natural join would be:
SELECT Position.PositionID, Position.Name AS PositionName, Employee.EmployeeID, Employee.Name AS EmployeeName
FROM Position INNER JOIN Employee ON Position.PositionID = Employee.EmployeeID;
Personally, I expect that SQL Server will never support NATURAL JOIN syntax.
Zoran