除了Aaron的答案,您还可以使用公用表表达式:
;with cte_FreeDaysRemaining as ( select frdFreedays - DateDiff(dd,conReceiptToStock,GetDate()) As FreeDaysRemaining --, more columns from yourtable ) select FreeDaysRemaining --, more columns from cte_FreeDaysRemaining where FreeDaysRemaining <= @intFreeDays
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)