Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

small problem

Status
Not open for further replies.

victorashi

IS-IT--Management
Joined
Jul 22, 2006
Messages
32
Location
RO
hello , i have here a procedure wich gives me all data from one employee, but the result table gives me more than 4 times the ID column , how should i write it so that it will bring me only one time this column ?

CREATE PROCEDURE EmployeeDetails
@nr int
AS
BEGIN
SELECT * FROM table1
INNER JOIN viza ON table1.id = viza.id
INNER JOIN work_prmit ON table1.id = work_permit.id
INNER JOIN pass ON table1.id = pass.id
LEFT OUTER JOIN married ON table1.id = married.id LEFT OUTER JOIN divorced ON table1.id = divorced.id
LEFT OUTER JOIN wife_dead ON table1.id = wife_dead.id
where
table1.id = @nr
END
GO
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top