创建存储过程中的问题 [英] Issues in creating Stored Procedure
问题描述
大家好,
我在SQL SP中遇到一些问题.
我有一张这样的桌子,名字叫Master.
EmpID名称模式Normal_ot Dayoff_ot
1 aaa缺席0 0
2 bbb当前0 1
3 ccc当前1 0
2 bbb目前2 0
从这个我需要用这些文件生成报告
EmpID名称ttl_Absent tt_Present Normal_ot Dayoff_ot
1 aaa 1 0 2 1
2 bbb 0 2 2 1
3 ccc 0 1 1 0
为此,除了创建存储过程外,我如何编写SP或有其他任何方法来生成报告.我正在使用Crystal Report生成报告,所以我可以使用Crystal Reports公式生成此报告.
还可以在前端使用c#Windows窗体.
在这种情况下请任何人帮助我
在此先感谢...
Hi all,
I am having some issues in SQL SP.
I am having a table like this with the name Master.
EmpID Name Mode Normal_ot Dayoff_ot
1 aaa absent 0 0
2 bbb Present 0 1
3 ccc Present 1 0
2 bbb Present 2 0
from this i need to generate a report with these fileds
EmpID Name ttl_Absent tt_Present Normal_ot Dayoff_ot
1 aaa 1 0 2 1
2 bbb 0 2 2 1
3 ccc 0 1 1 0
for this how can i write the SP or is there any other ways to generate report other than creating an Stored Procedure. I''m using crystal report to generate the report, so am i can generate this report with crystal report formulas.
Also using the c# windows form in the front end.
Please any one can help me in this case
Thanks in Advance...
推荐答案
使用此 ^ ]和具有求和功能的分组依据 [
by using this Case When[^] and Group By with Sum Function [^] you can achieve the solution.
try your self first, if you are not then tell me i will do that.
这篇关于创建存储过程中的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!