For for incorrect sql (aggregates with columns)