我想要每个组calendarID / structureID的范围内的MIN(date),并且具有-1值和等级14。例如,calendarID 15555和StructureiD 20391将具有min(date)5/28/2014。
茶几
date instruction grade calendarID structureID
5/27/2014 0 14 15555 20391
5/28/2014 -1 14 15555 20391
5/29/2014 -1 14 15555 20391
5/30/2014 0 14 15555 20391
8/14/2013 -1 14 15516 19996
8/15/2013 -1 14 15516 19996
8/16/2013 -1 14 15516 19996
8/19/2013 -1 14 15516 19996
8/20/2013 -1 14 15516 19996
SELECT MIN([date])
FROM [DAY]
WHERE instruction = '-1'
AND grade = '14'
GROUP BY calendarID
, structureID
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句