mysql avg函數(shù) mysql中求多列數(shù)據(jù)的同一行數(shù)據(jù)的平均值怎么做?
mysql中求多列數(shù)據(jù)的同一行數(shù)據(jù)的平均值怎么做?這個要用到子查詢的,看你寫在哪一行的avg字段了,加個條件過濾下就好了update test1 set avg=(select AVG(count)
mysql中求多列數(shù)據(jù)的同一行數(shù)據(jù)的平均值怎么做?
這個要用到子查詢的,看你寫在哪一行的avg字段了,加個條件過濾下就好了
update test1 set avg=(select AVG(count) FROM test1 WHERE id<=501 && id>=497) where id="你想寫入的id所在的行"
mysql中用sum函數(shù)求出的結(jié)果是什么類型的?
The SUM() and AVG() functions return a DECIMAL value for exact-value arguments (integer or DECIMAL), and a DOUBLE value for approximate-value arguments (FLOAT or DOUBLE). (Before MySQL 5.0.3, SUM() and AVG() return DOUBLE for all numeric arguments.)