Hi there,
I created a simple example that models the sql statement that Christian Lechner posted. It was done via Data Retrieval rather than Aggregation mode. The generated SQL is below:
I found this article quite helpful: DB Lookup Expression - Business Rule Framework plus (BRFplus) - SAP Library under the heading - Field mapping - Field aggregation and grouping.
In order to only group by one field all other fields have to be removed from the select.
So I think with BRFplus you can utilize the group by sql statements in a db lookup. The exported xml of the expression is also attached.
I hope this helps