Database systems are the core of management information systems and one of the most important computer applications. From the perspective of most system application instances, query operations account for the largest proportion of various database operations. Let's take a closer look at the common query statements in queries-select statements!
This is the general query method of the SELECT statement.
Next, let's take a look at each query method separately.
1. Simple SELECT query
2. Where condition Query
A select statement containing the WHERE clause is called a conditional query statement. A table usually has thousands of records. When you only need a portion of the records, you need to use the WHERE clause to specify a series of query conditions.
3. query by group
The group by clause divides rows in a table into different groups. Summarize each group separately, so that you can control the level of detailed information you want to see
Notes:
A. In the field list of the select clause, except for the clustering function, other fields must be defined in the group by clause. For example: "group by a, B", then "select sum (A), C" has a problem.
B. The Field List of the select clause does not have to have a clustering function, but at least one project in the list of group by clauses must be used. For example, if "group by a, B, c", "select a" is acceptable.
C. in SQL Sever, fields of the text, ntext, and image data types cannot be used as grouping bases for group by clauses.
D. The field alias cannot be used for group.