SELECT q.id as questionid, c.id as parentid, q.title, q.fullsccres as qscore, c.name, c.fullscores as cscore FROM question_tb as q INNER JOIN question_categories_tb as c ON q.question_id = c.id WHERE c.question_id = 2 ORDER BY c.id
Code (PHP)
question_categories_tb as c //ให้ตารางนี้มีชื่อย่อว่า c แล้วนำไปไว้หน้าฟิลครับ เช่น c.name