如何创建存储过程以获得每个学生的每月出勤率? [英] how to create stored procedure to get monthly attendance percentage of each students?

查看:82
本文介绍了如何创建存储过程以获得每个学生的每月出勤率?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个存储过程,以便根据工作日的总数来获得每月的工作时间。工作日也将在删除总假日后的月份计算,有人可以帮助我吗?

i want to create a stored procedure to get monthly attedance on the basis of total number of persent out of working day .and working day also will count in month after removing total number of holiday ,can anybody help me ?

推荐答案

请查看以下示例:



Please check below example:

declare @Results table (
    Id int not null,
    Answer int not null,
    NoOfComments int not null
)
insert into @Results (Id,Answer,NoOfComments) values
(18,      1,        2),
(19,      2,        0),
(20,      3,        0),
(21,      4,        0),
(22,      5,        1)

select *,((NoOfComments * 100.0) / SUM(NoOfComments) OVER (PARTITION BY (1))) as Pcnt
from @Results





*这只是一个例子而不是存储过程



* This is only example not a stored procedure


这篇关于如何创建存储过程以获得每个学生的每月出勤率?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆