只有一个返回值
AVG() - 平均值
SELECT ROUND(AVG(goods_price),2) AS avg_price FROM tdb_goods;
COUNT() - 计数
SELECT COUNT(goods_id) as counts FROM tdb_goods;
MAX() - 最大值
SELECT MAX(goods_price) as counts FROM tdb_goods;
MIN() - 最小值
SUM() - 求和
SELECT SUM(goods_price) as counts FROM tdb_goods;

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注

Captcha Code