You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DS7/DSWeb/word/新协航_设计文档/数据库建表文档/20131120/获取指定合同和名称的费用functino.sql

27 lines
561 B
MySQL

2 years ago
--drop function [get_Fee]
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create function [dbo].[get_Fee](@Contractno varchar(50),@Feename varchar(50),@Feetype tinyint)
returns numeric(18,2)
as
begin
declare @S numeric(18,2)
select @S=(
select sum(cf.amount) from ch_fee cf where cf.bsno=@Contractno
and cf.feename=@Feename and cf.feetype=@Feetype)
if @s is null
set @s=0
return @S
end
GO
select dbo.[get_Fee]('XXH201311180001','β<EFBFBD><EFBFBD>',1)
select * from ch_fee