我有一个看起来像这样的表(抱歉但不知道如何以表格形式放置东西):
| ID| Status | Business Area |Business sub area| ...|
1 | ongoing| Area 1 | Null | ...|
2 | closed | Area 2 | Sub-area a | ...|
...
我需要计算每个列的不同条件的所有情况(基于状态的计数),但按业务范围或业务子区域中的特定值进行分组。
我想要的表格具有以下结构
Groups | total | count of ongoing | count of closed |
Area 1 | 10 | 5 | 5 |
Sub-area A| 6 | 3 | 3 |
我的问题与获取列无关,因为我可以解决这个问题,但我不知道是否可以按照我上面的方式对记录进行分组。
对于我的表,在业务范围字段中将存在我不希望记录分组的值,对于子区域组也是如此,这就是为什么我希望组的方式是特定值而不是整个字段的原因
如何按SQL Server中不同字段中存在的特定值进行分组?
答案 0 :(得分:0)
如果我理解正确,您可以使用var s = 0;
score.text = s;
var mixed:Array = new Array;
mixed.push(orange);
mixed.push(cheese);
mixed.push(lobbio);
mixed.push(meat);
mixed.push(fish);
for (var i:uint = 0; i < mixed.length; i++) {
mixed[i].addEventListener(MouseEvent.MOUSE_DOWN, drag);
mixed[i].addEventListener(MouseEvent.MOUSE_UP, drop);
function drag(e)
{
e.target.startDrag();
}
function drop(e)
{
e.target.stopDrag();
if( (cheese.y > 50 && cheese.y < 150) && (cheese.x > 480 && cheese.x < 570) )
{
cheese.x = -50;
cheese.y = -50;
s = s + 10;
score.text = s;
}
if( (mixed[i].y > 50 && mixed[i].y < 150) && (mixed[i].x > 480 && mixed[i].x
< 570) )
{
mixed[i].y = -50;
mixed[i].x = -50;
s = s + 10;
score.text = s;
}
}
}
:
COALESCE()