Topic: 求助sql

  Print this page

1.求助sql Copy to clipboard
Posted by: parjiyon
Posted on: 2006-12-27 16:38

有一张表a,b,c为三个字段,avg为a,b,c的平均值
id a b c avg
1 2 2 2 2
2 1 2 3 2
3 2 2 5 3
4 2 5 5 4
5 3 4 5 4
6 6 4 2 4
我做了一个触发器,当insert纪录时,就算出avg,现在将表中的纪录每2条作为1组,1和2为一组,3和4为一组。。。并且要算出这一组纪录中avg的平均值,也就是(纪录1的avg加上纪录2的avg)/2。并把求出的平均值放入另一张表里。后面的部分该怎么做呀???


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923