下面的 sql 查询在 localhost 中工作,当我在 Web 服务器中尝试它时它不起作用。
SELECT t1.student_id,t1.id AS id1,t2.id AS id2,t3.id AS id3,t1.costperhour AS cs1,t2.costperhour AS cs2,t3.costperhour AS cs3,t1.sub_hours AS th1,t2.sub_hours AS th2,t3.sub_hours AS th3,MIN(t1.subjectass_id) AS sub1,MIN(t2.subjectass_id) AS sub2,MIN(t3.subjectass_id) AS sub3 FROM tb_adhocdetails t1
LEFT JOIN tb_adhocdetails T2
ON t1.student_id = t2.student_id
AND t2.subjectass_id > t1.subjectass_id
LEFT JOIN tb_adhocdetails T3
ON t2.student_id = t3.student_id
AND t3.subjectass_id > t2.subjectass_id
LEFT JOIN tb_adhocdetails T4
ON t3.student_id= t4.student_id
AND t4.subjectass_id > t3.subjectass_id
WHERE t1.student_id=360