日期:2014-05-17 浏览次数:20580 次
select o.instrumentName,a.name,sum(t.actualUseNumber) 测样数目,t.sysTime
from testTotal t,adminInfo a,order_instrument o
where a.id = t.adminId and o.id = t.instrumentId and sysTime between '2012-10-01' and '2012-12-01'
group by a.name
服务器: 消息 8120,级别 16,状态 1,行 1
列 'o.instrumentName' 在选择列表中无效,因为该列既不包含在聚合函数中,也不包含在 GROUP BY 子句中。
服务器: 消息 8120,级别 16,状态 1,行 1
列 't.sysTime' 在选择列表中无效,因为该列既不包含在聚合函数中,也不包含在 GROUP BY 子句中。
select a.name,sum(t.actualUseNumber) 测样数目
from testTotal t,adminInfo a,order_instrument o
where a.id = t.adminId and o.id = t.instrumentId and sysTime between '2012-10-01' and '2012-12-01'
group by a.name
select o.instrumentName,a.name,sum(t.actualUseNumber) 测样数目,t.sysTime
from testTotal t,adminInfo a,order_instrument o
where a.id = t.adminId and o.id = t.instrumentId and sysTime between '2012-10-01' and '2012-12-01'
group by o.instrumentName,a.name,t.sysTime
SELECT NAME ,
instrumentname ,
MAX(systime) systime ,
SUM(测试数目) 测试数目
FROM TB
GROUP BY NAME ,
instrumentname