For example, the group statement:
select year,count(id) num from tblPlantProduce
group by year
In this statement to filter out the year > There are two ways in 2005:
1.group foregoing conditions was added where: where year> 2005
2.group by year later having joined conditions: having year> 2005
If you want to filter out id> 5000 can only have one way of:
group preceded where id> 5000
If you want to filter out the num> is also only one way to 5000:
Group by year later added having count (id)> 5000
From here you can see the implementation of the order group by sql statement syntax is as follows:
1. First screening where conditions;
2. A further group by group, select out previously acquired field can be seen as a new temporary table;
3. then having this new temporary table filter, the filter field can only have a temporary new table.