输入banner图图片脚本导航/分类

SQLAlchemy的group_by和order_by的区别

apply one or more GROUP BY criterion to the query and return the newly resulting Query

功能:去重和排序

2、官网解释:

order_by(*criterion)

apply one or more ORDER BY criterion to the query and return the newly resulting Query

All existing ORDER BY settings can be suppressed by passing None - this will suppress any ORDER BY configured on mappers as well.

Alternatively, an existing ORDER BY setting on the Query object can be entirely cancelled by passing False as the value - use this before calling methods where an ORDER BY is invalid.

功能:只是排序,并不去重

参考:

1、http://docs.sqlalchemy.org/en/rel_0_9/orm/query.html

SQLAlchemy的group_by和order_by的区别

标签:log   esc   setting   native   exist   cell   doc   apply   order