Hi, I have an error when query with grouping.
The code querying and grouping is this (snipped):
var logs := TList<TGQLELog>.Create;
try
var model := CHANNEL_TEXT[CH_TRACE];
var Manager := TObjectManager.Create(DBConnectionCache(model).Connection, TMappingExplorer.Get(model));
try
var events := Manager.Find<TEL_Events>
.Select(TProjections.ProjectionList
.Add(Linq['SessionId'].Group.As_('SessionId'))
.Add(Linq['Actor'])
.Add(Linq['Start'])
.Add(Linq['Stop'])
.Add(Linq['Elapsed']))
.Where(Linq.Eq('ChannelId', CH_TRACE) and
Linq.GreaterOrEqual('Start', dateFrom_) and Linq.LessOrEqual('Start', dateTo_) and
Linq.Eq('ClientId', 0))
.OrderBy('Start', True).OrderBy('Stop', False)
.List;
for var E in events do
logs.Add(TGQLELog.Create(E));
finally
Manager.Free;
end;
Result := logs.ToArray;
finally
logs.Free;
end;
and the error is:
{
"data": {
"errors": [
{
"message": "Field is not included in GROUP BY list. Table name = 'A', Field name = 'ID', FieldNo = 0, Found field name = 'ID' - Native error: 10342",
"locations": [
{
"line": 2,
"column": 5
}
],
"extensions": {
"code": "EABSException"
}
}
]
}
}
all fields exists in table, and ID field too but is not required for this query.
Whats is wrong ?
Thanks.
Esteban