用户ID的罚款总和。 [英] Sum of fines for a user id.

查看:65
本文介绍了用户ID的罚款总和。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在做一个图书馆管理项目。在CheckIN / OUT表格中,我已经存储了已发布和返回的书籍详细信息,如果这本书还包括罚金额我还有另一张名为finedetails的表。在前端,当我输入一个特定的学生ID时,我希望存储在CheckIN / OUT表中的所有罚款总和为该学生ID。我怎么能完成这个?请任何人帮帮我。



提前致谢。

Hello every one,
I am doing a library management project.In that in CheckIN/OUT table i have stored issued and returned details of the book and this also includes amount of fine if the book is returned late.I have another table called "finedetails".In front end when i enter a particular student id, i want sum of all the fines stored in "CheckIN/OUT" table for that student id.How can i accomplish this?Please any one help me.

Thanks in advance.

推荐答案

试试:

Try:
SELECT SUM(Fines) FROM CheckInOutTable WHERE StudentId=666



但是,这可能是存储数据的一种不好方法:记住,在大多数图书馆中,罚款增加在每天返回书籍之前 - 所以最好动态计算罚款而不是存储n的值每天都要改变。


However, that is probably a bad way to store your data: remember, in most libraries the fines increase on a daily basis until the book is returned - so it might be better to dynamically work out the fines instead of storing a value which needs to change on a daily basis.


这篇关于用户ID的罚款总和。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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