赞
踩
1、distinct
- select count(distinct CName) from Course
- select count(CName) from (select distinct CName from Course) as temp
2、group by
select count(1) from Course group by CName
3、数据库内随机抽取几条数据
- from sqlalchemy.sql.expression import func
-
- (变量) = (模型名).query.order_by(func.random()).limit(随机几条).all()
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。