alter function getPrice(@packkg float,@PID nvarchar(50),@Express int) returns float
as
begin
declare @pprice float
select @pprice=(BC+((@packkg-AC)*DC)/CC) from PPrice where
PID=@PID and
Express=@Expressreturn round(isnull(@pprice,0),0)
end
CREATE TABLE [dbo].[PPrice] (
[Gid] [int] IDENTITY (1, 1) NOT NULL ,
[PID] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
[Express] [int] NULL ,
[AC] [float] NULL ,
[BC] [float] NULL ,
[CC] [float] NULL ,
[DC] [float] NULL ,
[Gdate] [datetime] NULL
) ON [PRIMARY]
GO
posted on 2011-08-25 23:29
sanmao 阅读(1249)
评论(0) 编辑 收藏