mirror of
https://github.com/grafana/grafana.git
synced 2025-09-23 12:42:50 +08:00
add alias when adding group by
This commit is contained in:
@ -101,6 +101,9 @@ export default class PostgresQuery {
|
||||
var selectParts = this.target.select[i];
|
||||
if (!selectParts.some(part => part.type === 'aggregate')) {
|
||||
selectParts.splice(1, 0, { type: 'aggregate', params: ['avg'] });
|
||||
if (!selectParts.some(part => part.type === 'alias')) {
|
||||
selectParts.push({ type: 'alias', params: [selectParts[0].params[0]] });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user