一、聚合与分组查询
1.1、准备数据
class Cook(models.Model):"""厨师"""name = models.CharField(max_length=32,verbose_name='厨师名')level = models.IntegerField(verbose_name='厨艺等级')age = models.IntegerField(verbose_name='年龄')sect = models.CharField(max_length=32,verbose_name='厨艺派系')class Meta:db_table='t_cook'
insert into t_cook (name,level,age,sect) values ("黑暗之女",6,20,"川菜");
insert into t_cook (name,level,age,sect) values ("狂战士",5,24,"粤菜");
insert into t_cook (name,level,age,sect) values ("卡牌大师",6,25,"川菜");
in