SQL语句应用纪录 [原]
今天有需要用到一些SQL的运算语句,所以便顺便上来写一下作个纪录,以后不用再翻书了,呵呵!
所选列的中间值
select count(列名) as cou from 表名 where 条件列名='条件'
所选列的平均值
select avg(列名) as av from 表名 where 条件列名='条件'
所选列中的最大值:
select max(列名) as ma from 表名 where 条件列名='条件'
先择列中的最小值:
select min(列名) as mi from 表名 where 条件列名='条件'
还没有任何评论。