2010-02-17 44 views

回答

12

Here是总

AVG() Return the average value of the argument 
BIT_AND() Return bitwise and 
BIT_OR() Return bitwise or 
BIT_XOR()(v4.1.1) Return bitwise xor 
COUNT(DISTINCT) Return the count of a number of different values 
COUNT() Return a count of the number of rows returned 
GROUP_CONCAT()(v4.1) Return a concatenated string 
MAX() Return the maximum value 
MIN() Return the minimum value 
STD() Return the population standard deviation 
STDDEV_POP()(v5.0.3) Return the population standard deviation 
STDDEV_SAMP()(v5.0.3) Return the sample standard deviation 
STDDEV() Return the population standard deviation 
SUM() Return the sum 
VAR_POP()(v5.0.3) Return the population standard variance 
VAR_SAMP()(v5.0.3) Return the sample variance 
VARIANCE()(v4.1) Return the population standard variance 

内置功能组的MySQL的名单我相信你想SUM()

0

SELECT SUM(COL)FROM表

+2

这将永远不会工作,你正在聚合col?分组? – 2010-02-17 12:55:29

14
SELECT 
    SUM(your_column) AS Total 
FROM 
    your_table; 

......或者这是一个有趣的问题? :)

3

SELECT SUM(sales) as "Revenue" FROM details;