Implement limit on a query.
Implement select statement on the datasource.
Implement groupBy clause on the datasource.