select a.workitemid as workitemid,a.testSort as testSort from examinee a
where testplanid=56 and testtype like '%_1_%' and theorytestRoom is not null
group by a.workitemid,a.testSort,a.theoryspotid,a.theorytestRoom
order by a.workitemid,a.testSort,a.theoryspotid,a.theorytestRoom查出结果是3 01
3 01
3 01
3 01
3 01
3 01
3 02
3 02
3 02
3 02
我现在要怎么修改可以统计出3 01 6
3 02 4
这种结果 最后加位总数
where testplanid=56 and testtype like '%_1_%' and theorytestRoom is not null
group by a.workitemid,a.testSort,a.theoryspotid,a.theorytestRoom ,a.testSort
order by a.workitemid,a.testSort,a.theoryspotid,a.theorytestRoom
where testplanid=56 and testtype like '%_1_%' and theorytestRoom is not null
group by a.workitemid,a.testSort
order by a.workitemid,a.testSort
where testplanid=56 and testtype like '%_1_%' and theorytestRoom is not null
group by a.workitemid,a.testSort,a.theoryspotid,a.theorytestRoom
order by a.workitemid,a.testSort,a.theoryspotid,a.theorytestRoom
where testplanid=56 and testtype like '%_1_%' and theorytestRoom is not null
group by a.workitemid,a.testSort
order by a.workitemid,a.testSort
a.workitemid as workitemid,a.testSort , count(*) as number
from
examinee a
where
testplanid=56 and testtype like '%_1_%' and theorytestRoom is not null
group by
a.workitemid,a.testSort,a.theoryspotid,a.theorytestRoom ,a.testSort
order by
a.workitemid,a.testSort,a.theoryspotid,a.theorytestRoom
(
select a.workitemid as workitemid,a.testSort as testSort from examinee a
where testplanid=56 and testtype like '%_1_%' and theorytestRoom is not null
group by a.workitemid,a.testSort,a.theoryspotid,a.theorytestRoom
) t
group by workitemid , testSort
order by workitemid , testSort
(
select a.workitemid as workitemid,a.testSort as testSort from examinee a
where testplanid=56 and testtype like '%_1_%' and theorytestRoom is not null
group by a.workitemid,a.testSort,a.theoryspotid,a.theorytestRoom
) t
group by workitemid , testSort
order by workitemid , testSortselect m.* , (select count(1) from
(
select a.workitemid as workitemid,a.testSort as testSort from examinee a
where testplanid=56 and testtype like '%_1_%' and theorytestRoom is not null
group by a.workitemid,a.testSort,a.theoryspotid,a.theorytestRoom
) n where n.workitemid = m.workitemid and n.testSort = m.testSort) from
(
select a.workitemid as workitemid,a.testSort as testSort from examinee a
where testplanid=56 and testtype like '%_1_%' and theorytestRoom is not null
group by a.workitemid,a.testSort,a.theoryspotid,a.theorytestRoom
) m
order by m.workitemid , m.testSort
上面直接加COUNTT()的都不对
只有8楼的可以查询出 不知道还有没有别的方法
上面直接加COUNTT()的都不对
只有8楼的可以查询出 不知道还有没有别的方法