插入行的总和并将其显示在同一个表中

时间:2015-08-14 10:10:41

标签: sql-server

我有一张如下所示的表格

enter image description here

我想在每个员工下面插入一行,其数据与员工代码,职称,项目相同,如同工作人员,工作人员,工作人员,工作人员,工作人员。将日期作为空值开始,将容量安装为该employees-184的所有安装容量的总和,并将%%分配为null。

结果应如下所示。

enter image description here

提前致谢。

2 个答案:

答案 0 :(得分:1)

试试这个:

header('Content-Type: image/png');          

$filePath                       =   JPATH_SITE.'/images/powered_by.png';
$image                          =   new Imagick("{$filePath}[0]"); // [0] means "first page"
$image->setImageFormat('png');
echo $image;            
exit;

答案 1 :(得分:1)

请尝试以下查询以生成所需的输出:

 insert into tbl(EmployeeCode, EmployeeName, projectName,ExpectedStartDate, ExpectedEndDate, InstallCapacity, [Actual Allocation Percentage])
    select  EmployeeCode,EmployeeName,'Bench' As projectName,NULL as ExpectedStartDate, NULL as ExpectedEndDate, SUM(InstallCapacity) as InstallCapacity, SUM([Actual Allocation Percentage]) as [Actual Allocation Percentage]
    from tbl
    group by EmployeeCode,EmployeeName

select * from tbl order by EmployeeCode,EmployeeName