博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
sql
阅读量:2493 次
发布时间:2019-05-11

本文共 886 字,大约阅读时间需要 2 分钟。

SQL> SELECT key,count,

DECODE (count, 1, (num+2)/3,
2, (num+1)/3,
3, num/count,
num/count) avg
FROM test
/
K COUNT AVG
- ---------- ----------
a 2 .9
b 1 .9
c 3 1
d 4 1.5

if exists(select count1 from bb1 where count1 >=3)

begin
update bb1 set number = round( number/count1,1)
end;
else if exists(select count1 from bb1 where count1 =2)
begin
update bb1 set number =round((number+1)/3,1)
end;
else update bb1 set number = round((number+2)/3,1)

decimal ld_standard,ld_ratio

dw_edit.AcceptText()
if dwo.name = "standard" or dwo.name = "ratio" then
ld_standard = round(dw_edit.GetItemDecimal(row,"standard"),4)
ld_ratio = round(dw_edit.GetItemDecimal(row,"ratio"),4)
dw_edit.SetItem(row,"ration",Round(ld_standard*ld_ratio,4))
end if

return 1

[@more@]

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/219138/viewspace-918098/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/219138/viewspace-918098/

你可能感兴趣的文章