Select中的SQL用户定义函数 [英] SQL User Defined Function Within Select
本文介绍了Select中的SQL用户定义函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在SQL中有一个用户定义的函数,称为getBuisnessDays,它使用@startdate和@enddate并返回两个日期之间的工作日数.如何在我的选择范围内调用该函数?
I have a user defined function in SQL called getBuisnessDays it takes @startdate and @enddate and returns the number of business days between the two dates. How can I call that function within my select?
这就是我想要做的..
Here's what I'd like to do..
SELECT getBusinessDays(a.opendate,a.closedate)
FROM account a
WHERE ...
推荐答案
是的,您几乎可以做到:
Yes, you can do almost that:
SELECT dbo.GetBusinessDays(a.opendate,a.closedate) as BusinessDays
FROM account a
WHERE...
这篇关于Select中的SQL用户定义函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文