SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 Express Edition and Compact Edition (2005)
 error in joining tables
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

balaram19
Starting Member

India
9 Posts

Posted - 02/22/2012 :  02:00:08  Show Profile  Reply with Quote
Hi,
Iam new to sql server, trying to join the two tables student and marks
student table has columns (stu_id,stu_name,stu_address), marks table colums are (stu_id,sub1,sub2,sub3)

when I'm trying to execute the following query Iam getting error like below.. can you gimme suggetion to recover from this.

Query:

select s.stu_name,m.sub1 from marks
left outer join student on m.stu_id=s.stu_id


Result:

Msg 4104, Level 16, State 1, Line 1
The multi-part identifier "m.stu_id" could not be bound.
Msg 4104, Level 16, State 1, Line 1
The multi-part identifier "s.stu_id" could not be bound.
Msg 4104, Level 16, State 1, Line 1
The multi-part identifier "s.stu_name" could not be bound.
Msg 4104, Level 16, State 1, Line 1
The multi-part identifier "m.sub1" could not be bound.


ivbalaram

balaram19
Starting Member

India
9 Posts

Posted - 02/22/2012 :  02:34:09  Show Profile  Reply with Quote
Prob solved..

when I changed query as

select s.stu_name,m.sub1 from marks m
left outer join student s on m.stu_id=s.stu_id




ivbalaram
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000