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
 SQL Server 2005 Forums
 Express Edition and Compact Edition (2005)
 error in joining tables

Author  Topic 

balaram19
Starting Member

9 Posts

Posted - 2012-02-22 : 02:00:08
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

9 Posts

Posted - 2012-02-22 : 02:34:09
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
   

- Advertisement -