Learn MySQL with teacher Wang: aggregate functionsTeacher: Wang Shaohua QQ Group No.: 483773664 Learning Content
Usage of COUNT (), SUM (), AVG (), MAX (), and Min () four aggregate functionsThe aggregate functions include count (), SUM (), AVG (), MAX (), and Min ().One, COUNT ()(a) IntroductionThe count () function
Tags: style blog http color ar using SP strong dataUsually because of the database study is not deep, so in the interview asked some of the usual encountered problems incredibly can not be very sure to answer, really let oneself very angry!One of the things that impressed me this time is:when using aggregate functions in MySQL such as AVG (t), T is a field of type int in the table, nullable, with three rows
This article introduced the MongoDB in the MapReduce implementation of data aggregation method, we mentioned MongoDB in the data aggregation operation of a way--mapreduce, but in most of the day-to-day use of the process, We do not need to use MapReduce to do the operation. In this article, we simply talk about the implementation of the data aggregation operation with the aggregation function.
In addition to the basic query capabilities, MONGODB provides powerful aggregation capabilities. There
Tags: An aggregate function is a function that performs a calculation on a set of values and returns a single value, which is often used in conjunction with the GROUP BY clause of a SELECT statement, and what aggregate functions are specifically in SQL SERVER? Let's take a look at: 1. AVG returns the average in the specified group, and the null value is ignored.
', ' Harry ', ' Math ', ' 81 '); INSERT INTO ' t_grade ' (' id ', ' stuname ', ' Course ', ' score ') VALUES (' 9 ', ' Harry ', ' English ', ' ""); #第五章: Single-table operation#第二节: Querying with aggregate functions#5.1:count () functionSELECT COUNT (*) from T_grade; #统计记录的条数SELECT COUNT (*) as total from T_grade; #添加别名Select Stuname,count (Course) as "number of accounts" from T_grade GROUP by Stuname,cou
:
4 MAX () function
Returns the maximum value for a column.
Cases:
SQL query:
?
1
SELECT MAX (age) from Tb_students WHERE age>15
Execution results:
5 MIN () function
Returns the minimum value of a column.
Cases:
SQL query:
?
1
SELECT MIN (age) from Tb_students WHERE age>15
Execution results:
6 aggregate functions
Aggregate function Count,max,min,avg,sum ...
Select COUNT (*) from T_employee
Select Max (fsalary) from T_employee
Sort ASC Ascending desc Descending
SELECT * from T_employee ORDER by Fage
First in descending order of age. If you are of the same age, in ascending order of salary
SELECT * FROM T_employee-Fage desc,fsalary ASC
Order BY is placed after the WHERE clause
Wildcard Filter
Wildcard filter with like
Word wildcard with ' _ '
Multi-character
";2. Find the information of the heroine of the country other than Shu and WuSELECT * from Sanguowhere country not in ("Shu", "WU")and sex= "female";3. Find the information of Shu hero Shing ID 1, 3 or 5SELECT * from Sanguowhere(ID in (1,3,5) and country= "Shu") or name= "Marten cicada";4, matching empty, non-empty1, empty: where name is null2, non-null: where name is NOT NULL3. Example1. Shu heroine information with a null valueSELECT * from Sanguowherename is null and country= "Shu" and sex= "
This article mainly describes the comparison between common DB2 functions and Oracle functions, including descriptions of type conversion functions, time and date, string functions, and mathematical functions, the following is a d
The following articles mainly introduce the comparison between common DB2 functions and Oracle functions. If you are curious about common DB2 functions and Oracle functions, this article will unveil the secrets of this article, th
DB2 column functions are one of our most commonly used functions. They calculate a group of values in the column to obtain a single result value. Let's take a look at the DB2 column functions.
DB2 column
Tags: decimal time function substr function ble name format Daquan binary ETHDB2 built-in functions are really a lot, it is almost impossible to master each function, so this article is not intended to describe the specific use of each function, but rather to provide an overview of the functions of each function, so that when you feel you need certain functions o
Oracle
How to present Oracle's relative functions in DB2 (III.)
Author:ccbzzp
In reality, you may often encounter some of the functions of Oracle in DB2,
Here I simply conclude that there may be many ways in which a function can be found, not all of which are listed here,
Welcome to all of you to continue, in order to
The following article describes how DB2 implements the functions of Oracle databases and summarizes its experience in actual operations, in this article, I will share with you some tips and experiences on implementing certain Oracle functions in DB2 ......
In practical applications, you may often encounter how to impl
Oracle
How to present Oracle's related functions in DB2 (IV.)
Author:ccbzzp
In reality, you may often encounter some of the functions of Oracle in DB2,
Here I simply conclude that there may be many ways in which a function can be found, not all of which are listed here,
Welcome to all of you to continue, in order to sh
Oracle
How to present Oracle's related functions in DB2 (i)
Author:ccbzzp
In reality, you may often encounter some of the functions of Oracle in DB2,
Here I simply conclude that there may be many ways in which a function can be found, not all of which are listed here,
Welcome to all of you to continue, in order to shar
When you store multilingual data in a DB2 UDB database, Unicode is often the only encoding that adapts to the entire range of data. DB2 can store and process Unicode data, but its sorting function is limited to binary ordering and three cultural sorts. In addition, a database can have only one collation, which is determined when the database is created. These sorting restrictions are an obvious challenge fo
The following articles mainly describe the types of commonly used DB2 functions. I saw the types of commonly used DB2 functions on the relevant website two days ago. I think it is quite good. I will share them with you, the following is a detailed description of the relevant content, hoping to help you in this regard.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.