Create PROCEDURE wls_GetRateByDate
@Date DateTime,
@Rate decimal(10,4) output
as
Begin
if exists(select MileageRate from MileageInfo where @Date between EffectiveDate and ExpirationDate)
select @Rate = MileageRate from MileageInfo where @Date between EffectiveDate and ExpirationDate
else
select @Rate = MileageRate from MileageRateHistory where @Date between EffectiveDate and ExpirationDate
end
GO
declare @Rate decimal(10,4)
execute wls_GetRateByDate '2005-5-19',@Rate output --加上output
select @Rate
@Date DateTime,
@Rate decimal(10,4) output
as
Begin
if exists(select MileageRate from MileageInfo where @Date between EffectiveDate and ExpirationDate)
select @Rate = MileageRate from MileageInfo where @Date between EffectiveDate and ExpirationDate
else
select @Rate = MileageRate from MileageRateHistory where @Date between EffectiveDate and ExpirationDate
end
GO
declare @Rate decimal(10,4)
execute wls_GetRateByDate '2005-5-19',@Rate output --加上output
select @Rate
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货