摘要:
use northwindgocreate function udf_GetStar (@ datetime)returns varchar(100)-- 返回日期所属星座,如果有静态的 星座对照码表 直接在查询中 join 效率相对更高beginreturn(--declare @ datetime--set @ = getdate()select max(star)from(select '魔羯座' as star,1 as [month],1 as [day]union all select '水瓶座',1,20union all select ' 阅读全文