我正在尝试通过子查询(qcat)表从问题顺序中获取记录。我的代码是
"SELECT * FROM question
where survey_name='$_SESSION[ssn_sname]' AND
qcategory IN
( SELECT qcategory FROM qcat
WHERE client_name='$_SESSION[ssn_sname]'
GROUP BY qcategory
ORDER BY p_order
) AND
status='1' AND
survey_name LIKE'%$sname%
LIMIT $start, $limit";
但它并没有按顺序得到结果。
如何通过 qcat 表获取行顺序?