I have a select query that joins 2 table. What I would like to happen is that the result of that query (2 join table) will be join to another select query result.
example (2 join table)
| x | y |
| 1 | x |
| 2 | y |
I think I was able to get what I wanted using this query
Select resScore, resTotal, y3.stuID, stuCourse, stuYearLevel, stuSection, accFName, accLName from (select * from result where result.exaID = ‘$exaID’) as y2 right join (SELECT student.stuID, stuCourse, stuYearLevel, stuSection, accFName, accLName FROM classlist LEFT JOIN account ON classlist.accID = account.accID LEFT JOIN student ON student.accID = account.accID INNER JOIN class ON classlist.claID = class.claID WHERE classlist.claID = ‘$class’ AND class.insID = ‘$user’) AS y3 on y2.stuID = y3.stuID order by accFName asc :x