The structure of table T3 is as follows: select * From t3id Edu age1 book 20 2 book 25 3 Book 30 4 Book 30 5 book 25 6 medium 15 7 medium 20 8 Medium 20 9 Specialized 20 10 specialized 20 11 specialized 20 12 specialized 30 13 expert 30 -------------------------------------- select distinct Edu, age from T3 order by age Edu age 15 in 20 in 20 in 20 in 25 in 30 In summary: 1, distinct Edu, age is to Edu, age two fields as one, as long as the EDU and age fields are the same, they will be treated as duplicate records; 2. Only one distinct or all can be used in select; 3. If distinct is used in select, all cannot be used; distinct cannot be used when all is used; it cannot exist at the same time; 4. If select distinct is specified, the items in the order by clause must appear in the selection list; ------------------------------- select Edu, age, count (*) as 'number' -- into from T3 -- where ID <10 -- filter condition recorded before the where group by Edu, age -- having grouping the group's filtering condition order by age Edu age Number of 15 1 in 20 1 in 20 2 in 20 3 in 25 2 in 30 2 in 30 2 In summary: 1. Distinct Edu, age regards the EDU and age fields as one. If the EDU and age fields are the same, the EDU and age fields are considered as the same group; 2. The column names in the select clause must be group columns or column functions. 3. The column names in the WHERE clause can be any fields in the table. 4. The column names in the having clause must be group columns or column functions;