Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to sum fields by mysql

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly shows you "mysql how to sum fields", the content is easy to understand, clear, hope to help you solve doubts, the following let the editor lead you to study and learn "mysql how to sum fields" this article.

In mysql, you can use the sum () function to sum fields, which returns the total number of numeric columns with the syntax "SELECT sum (evaluated field) FROM 'table name".

The operating environment of this tutorial: windows10 system, mysql8.0.22 version, Dell G3 computer.

How to sum fields by mysql

In mysql, if you want to sum fields, you need to take advantage of the sum function.

The SUM () function returns the total number of numeric columns.

The syntax is as follows:

SELECT SUM (column_name) FROM table_name

Examples are as follows:

Summation command

Mysql > select SUM (price) from order where create_time > '2016-03-12 row in set + | SUM (price) | +-+ | 37.40 | +-+ 1 row in set is all the content of this article "how to sum fields in mysql". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report