I have two tables tbl_studentapplicationdetails
and tbl_studentqualification
...
My second table contains studentId and qualificationId... Now i want to join two tables to get list of students with their qualification...
NOTE: Some students may have two or three qualification.... And my query is
select distinct t1.dStudent_id,t1.dStuFirstname,t1.dStuLastName,t1.dGender,
t1.dFatherName,t1.dOcupation,
t1.dAddress,t1.dContactNumber,t2.dMarks as sslc,t3.dMarks as hsc,
t4.dMarks as diplomo from tbl_studentapplicationdetails as t1
inner join tbl_studentqualification as t2 on t2.dQualification = '1'
inner join tbl_studentqualification as t3 on t3.dQualification = '2'
left join tbl_studentqualification as t4 on t4.dQualification = '7'
And my tbl_studentqualification
is
EDIT: I want to select all the records for students having two qualifications and students having three qualification....