>Hi Albert,
>
>I think the way it should be handled is that you split the SQL into two different SQL statements. The first one will just have the primary key field and the fields being aggregated, then you join the result of that SQL with the original table to get the other fields that you want.
Sometimes this is a must, specially if memos are involved, or you just feel it's silly to include customer.name in the group by (i.e. any repeating field from a joined table).
Generally, it would be nice if we had a first() or last() aggregate function, so we could use them on such fields where we don't really care from which record will the value come.
I write the new SQLs to be 80 compliant. As for the old ones, I usually convert them all, and try to have the time to do that. Sometimes, situations when I have to include the unimportant fields (which are either repeating or included because the customer wanted some reminder in the report) are a real waste of time, specially when some field needs to be added/removed - and then one has to remember to add/remove it in the Group By as well.