Home >Database >Mysql Tutorial >MYSQL必知必会读书笔记第十和十一章之使用函数处理数据_MySQL

MYSQL必知必会读书笔记第十和十一章之使用函数处理数据_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-05-27 13:44:461171browse

代码如下:


select avg(prod_price) as avg_pricefrom products;

- 计数

使用count(*)对表中行的数目进行计数(whether null or not)

使用count(column)对特定列具有值的行进行计数,忽略null

求和

使用sum()返回指定列值的和


以上所述是小编给大家介绍的MYSQL必知必会读书笔记第十和十一章之使用函数处理数据的相关知识,希望对大家有所帮助!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn