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 2000 Forums
 SQL Server Development (2000)
 Matching two columns while using joins

Author  Topic 

Swati Jain
Posting Yak Master

139 Posts

Posted - 2006-08-01 : 05:29:38
select batchid,lecturefacultyid from batch

output
batchid,lecturefacultyid
-----------------------
1 3
2 2

I want to match this whole column with(batchid,lecturefacultyid)
with the column of feedback table.


with the columns of Feedback table

batchid facultyid
-----------------------
1 3
2 2

How can i do this?

output should be only matching (batchid,lecturefacultyid)



khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-08-01 : 05:35:06
like this ?
select b.batchid, b.lecturefacultyid
from batch b inner join feedback f
on b.batchid = f.batchid
and b.lecturefacultyid = f.facultyid



KH

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-08-01 : 11:11:45
Learn SQL
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -