Conditional join in Mysql select statement -


Text after "

I have two tables tbl_studentapplicationdetails and tbl_studentqualification ... my second table I have student ID and qualification ID ... Now I want to join two tables to get the list of students with my qualifications ...

Note: Some students There can be two or three qualifications .... and my question is

  select specific t1.dStudent_id, t1.dStuFirstname, t1.dStuLastName, t1.dgender, t1.dfatherName, t1 .dOcupation, t1.dAddress, t1 DContactNumber, t1 internally as tbl_studentapplicationdetails as t2.dmarks as SSLC, t3.dmarks as HSC, t4.dmarks on T3.dQualification = '2' as t3 left t3.dQualification = '1 Joining the 'tbl_studentqualification' joining the T2 tbl_studentqualification on tbl_studentqualification to join tbl_studentqualification as t4.dQualification = T4 as the '7'  

and my Tbl_studentqualification is

Edit: I want to select all REC two eligibility students Orders for students having three qualifications ....

As of now, your joining less Understand because you are not joining the eligibility table with application details. Given that you want to separate the student ID, you will only get one line per student.

If I understand what you want, so if you one Student line qualification (1,2, 7) of each type, so you'd rather ( I hope it is correct) should try this way:

  dStudent_id, dStuFirstname, dStuLastName, dGender, dFatherName, dOcupation, dAddress, dContactNumber, Q1. As Dimsiars SSLC, q2.d as Marcus HSC, q7.d brands leave as related Tielbi_stidentpplifikeshn as Diplomo LEFT JOIN tbl_studentqualification q1 ON (q1.dStudent_id = dStudent_id and q1.dQQ = 1) two q2 at (q2.dStudent_id = join as dStudent_id) and q2.dQualification = '2') Left q7 on join tbl_studentqualification (q7.dStudent_id = dStudent_id and q7.dQualification = '7')  

Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -