the below is my join query for getting some result
create procedure sp_bindexamclass(@classid int,@examid int) as begin select en.ExamName,St.Standered_name,Sr.SubjectName,ec.Maximummark,ec.Minimummark from Standered_details St inner join ExamClasssetting_details ec on St.Standered_id=ec.Classid inner join SubjectRegistration_details Sr on Sr.SubjectCode=ec.subjectid inner join ExamNameSetting_details en on en.ExamId=ec.ExamId where ec.Classid=@classid and ec.ExamId=@examid end
Table relation is
1.standered details
relational key is
Code
standered_idCode
classid2.SubjectRegistration_details
relational key is
Code
subjectcodeCode
subjectidExamclasssetting_details
3 .ExamNamesetting_details
relational key is
Code
ExamIdCode
ExamIdall the table contains data for join query. but i couldnt get the desired result. what is the problem in join query.

pradeep kumar72 reputationPosted Dec 9, 2012, 9:39 AM EST
I think it's datatype error...,
as
begin
selecten.ExamName,St.Standered_name,Sr.SubjectName,ec.Maximummark,ec.Minimummarkfrom Standered_details St
inner join ExamClasssetting_details ec onSt.Standered_id=ec.Classid
inner join SubjectRegistration_details Sr onSr.SubjectCode=ec.subjectid
inner join ExamNameSetting_details en onen.ExamId=ec.ExamId
where ec.Classid=@classid
and ec.ExamId=@examid
end
inner join SubjectRegistration_details Sr onSr.SubjectCode=ec.subjectid
here i think u r trying to equal int=string...., data type of subjectcode...,?
baskaran chellasamy112 reputationPosted Dec 9, 2012, 8:09 PM EST
Deepak VermaRank #672 · 3.6K reputationPosted Dec 16, 2012, 6:16 PM EST
If you still don't find solution, plz upload schema and data of tables used in the query.