如何在sql server中重置日期更改ID [英] How to reset ID on date change in sql server
本文介绍了如何在sql server中重置日期更改ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在为医院病人opd创建查询
i希望opd no shuld可以重置并从日期更改开始,例如
i am creating query for hospital patient opd
i want that opd no shuld be reset and start with 1 on date change like
Date opdNo
20-01-2016 01
20-01-2016 02
20-01-2016 03
20-01-2016 04
20-01-2016 05
21-01-2016 01
21-01-2016 02
21-01-2016 03
22-01-2016 01
22-01-2016 02
是否可以在sql ??
请帮助
谢谢
Is it possiable in sql ??
please help
Thanks
推荐答案
我想opdnr是由触发器设置的,所以将触发逻辑更改为你的需求。
I guess the opdnr is set by a trigger, so change the trigger logic to your needs.
这篇关于如何在sql server中重置日期更改ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文