I am running the query below to get data from 4 tables, but the problem that data is fetched as Cartesian product, in other words, items from tblEdu is being duplicated with items from tblTrain
SELECT tblpersonal.*, tbltrain.*, tbledu.*, tblrequests.intReqId
FROM tblpersonal
LEFT JOIN tblrequests ON tblpersonal.intCompNo = tblrequests.intCompNo
AND tblrequests.intReqId = (SELECT MAX(req.intReqId) FROM tblrequests AS req WHERE req.intCompNo = tblpersonal.intCompNo)
LEFT JOIN tbltrain ON tblpersonal.intCompNo = tbltrain.intCompNo
LEFT JOIN tbledu ON tblpersonal.intCompNo = tbledu.intCompNo
WHERE tblrequests.intReqId IS NOT NULL
AND tblpersonal.intCompNo = 12368
GROUP BY tblpersonal.intCompNo, tbltrain.intTrainId, tbledu.intEduId
ORDER BY tblpersonal.intCompNo, tbledu.intEduId, tbltrain.intTrainid;
It's hard to say what the issue is without example data.
But you're only joining tbltrain and tbledu on intCompNo. Which maps back to tblpersonal.
So at a guess, you need to add more join criteria between these tables!