Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 i cant get an inner join to work

Author  Topic 

north west lad
Starting Member

1 Post

Posted - 2011-03-21 : 16:36:36
hi ive been trying to get this to work for hours but to no avail..plz can someone help me..thank you..


select EmployeesTable.Employee_Name,ProjectTable.Project_Name
from EmployeesTable
inner join ProjectTable
on ProjectTable.Project_Number=EmployeesTable.Employee_Number


my two tables are called employees table and projecttable..should it be inner join i use?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-03-21 : 16:45:35
You haven't provided enough information for us to help you. Whether or not it's an inner join or not is dependent upon your data requirement.

So what problem are you trying to solve? Give us a description, sample data, and expected output.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2011-03-21 : 17:00:38
I...Don't Know

"What She Said"

Try this




SELECT e.Employee_Name
, p.Project_Name
FROM EmployeesTable e
FULL OUTER JOIN ProjectTable p
ON p.Project_Number = e.Employee_Number






Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page
   

- Advertisement -