The meaning of group by in SQL query is to combine the total function to group the result set according to one or more columns. Its function is to divide a data set into several small ones through certain rules. area, and then perform data processing on several small areas.
1. The group by in the sql statement is: The GROUP BY statement is used to combine the total function to group the result set according to one or more columns.
2. Advanced syntax of sql statement group by:
1. Write a sql statement to create a table. Of course, we can also create it with a design drawing;
2. Select * from student, we enter a query statement to display all the data we just inserted;
3. select stuname, COUNT(*) from student group by student. From the above results, it is not difficult to see that we have grouped students according to their names. Another way to say it is to filter out the duplicates, group the name column in the student table with group by, and use the aggregate function (count) to make statistics. The number of occurrences of each name.
#There are many techniques in Sql statements. Generally, in addition to the addition, deletion, modification and query when we first learn, there are many others. When installing, be sure to remember to check the bitrate of your operating system. If you have a 32-bit operating system, install a 32-bit Sqlserver version. There is no limit on the version, either 2005 or 2012.
Recommended tutorial: "sql tutorial"
The above is the detailed content of What is the meaning of group by in sql query. For more information, please follow other related articles on the PHP Chinese website!