-
select Large Category, Small Category, min(value) from table name group by Large Category, Small Category.
-
select * from (
select Major, Small, min (value).
from table.
group by 大类,小类) t
order by t.Large class, small class.
-
select large category, small category, min(value) from table
group by Large Category, Small Classification.
The duel is correct, tested and the best.
-
The best answer to this question is hidden.
-
Grouped queries are generally used for statistical data, and grouping allows you to summarize the results at a glance.
1. If there is the following data in the EMP table:
2. According to the deptno grouping, query the summary value of the SAL of each group, which can be used with the following statement:
select deptno,sum(sal) from emp group by deptno;
3. Query result:
-
Sometimes you need to count by group, so you need to use group query.
Generally, in the database, the software is used as an operation tool, and the processed data is stored in the database in a detailed way, such as: employee number, name, department, entry date, age, gender, ID number, position...
And in practice, you may want to know:
How many people are there in each department? select department, count(*)from table where condition group by department.
How many men and women are there? select gender, count(*)from table where condition group by gender.
-
The main purpose is to summarize the grouping, for example, to query the number of students in each class, it is necessary to summarize the class and then calculate the number of students.
-
Oracle has duplicate values, grouped and taken as 100
The business table is very large, and it cannot be taken as an example alone, but the general meaning is as follows: 1The no field is used as the main field to group groups.
2.With the hunger group letter a no, will correspond to a different name. 3.
If the charge item contains '10', the no field is the only one in the table and is not repeated. 4.Target statement:
When the charge prominently contains the item '10', no= is counted'1'and name='Zhang San', all the items that collect or disturb the fee. The business table is very large, and it cannot be taken as an example alone, but the general meaning is as follows: 1
The no field is used as the main field to group groups. 2.The same の will correspond to different names.
3.Target statement: When the charge prominently contains the item '10', no= is counted'1'and Name='Zhang San', the sum of the corresponding amounts of all charging items.
1.The no field is used as the main field to group groups.
select ,sum(a.amount) from table a group by
2.The same の will correspond to different names.
select ,a.Name, sum(a.).amount) from table a group by ,aName.
3.Target statement: When the charge prominently contains the item 'salt', then no= is counted'10'And name='Zhang San', all charging items are right.
select a.Project, sum(a.).amount) from table a where a
Charges='1' and = 10' and a.Name='张三' group by aProject.
It is recommended that you write a stored procedure, and I will write one for your reference! cardno is a custom data type! It's easy to make mistakes with triggers. >>>More
So be it. Boss AThe wife is in order, and so on.
Go with C1, and there is only one woman on the right side of the --- back C. It's okay to go with women) Go, b1 back. >>>More
Fill in the blanks: 1. The t-sql command to modify the structure of the data table is (alter)table; The command to delete a table is to specify the ascending order with (asc) and the descending order with (desc) in the (delete) by clause. If you don't specify ascending or descending order, it defaults to (ASC). >>>More
This article writes about the author's inner world, one without troubles; There is no strife; There is no world of pain either. The village in the author's mind is beautiful with some simple people, and the author hopes that the people around him will be like what he said in his article. The author hopes that such a world will remove the darkness from his heart.
1 --Oracle deduplicates records, which can be operated using Oracle's unique rowid such as: >>>More