Function里面如何做2个数据的相减...........
drop Function test;CREATE Function jc_test(acctno varchar(50),date date)
RETURNS decimal(17,2)
BEGIN ATOMIC
DECLARE zzz decimal(17,2) default 0;
DECLARE zzz1 decimal(17,2) default 0;
SET zzz =(select sum(bal) from tztest where acctno=acctno and date =date);
SET zzz1 =(select sum(bal) from tztestwhere acctno=acctno and date =date(days(current date)-1) );
写到这里,写不下去了,,,,如何让zzz-zzz1相减 该怎么写啊?!
请教!!!!!!!!!
页:
[1]