本帖最后由 ysjy 于 2023-6-7 17:11 编辑
我按照你说的方式来写了之后 我的查询语句直接没有了,但是参数值什么的都还在
我的查询语句是这样的
SELECT
a.id,
GROUP_CONCAT( a.sampleNumber ) AS sample,
a.`name`
FROM
(
SELECT
t1.id AS id1,
t2.sampleNumber,
t3.testItemId,
t3.id,
t4.`name`,
t3.orderNum
FROM
sub_task t1
LEFT JOIN task_sample t2 ON t1.id = t2.subTaskId
LEFT JOIN test_course t3 ON t1.id = t3.subTaskId
LEFT JOIN test_item t4 ON t3.testItemId = t4.id
WHERE
t1.taskId = ( SELECT id FROM delegate_task WHERE delegateNumber = 这里添加模糊查询 ? )
AND t3.state != "检测项中止"
AND t4.NAME NOT LIKE "%%EL测试%%"
ORDER BY
t1.id,
t3.orderNum
) a
GROUP BY
a.id
ORDER BY
a.id1,
a.orderNum
|