mysql - Looking up for multiple results -


studentprofile -studentid  registration -registrationid -studentid(foreign key studentprofile)  registrationschedule -regscheduleid(is not primary key,, not unique,,can have lot of instances) -registrationdid(foreign key registration) -scheduleid  schedules -scheduleid 

please keep in mind there no regscheduleid in schedules table i'v tried inner joining them on result comes how can schedules of student

this information, student's profile, schedule details.

select t.studentid, s.scheduleid studentprofile t join registration r     on t.studentid = r.studentid   join registrationschedule rs      on r.registrationid = rs.registrationdid   join schedules s on rs.scheduleid = s.scheduleid 

remove tables not need in query.

if want filter specific student, add where t.studentid = 1234.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -