File tree Expand file tree Collapse file tree
adminforth/dataConnectors Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -403,16 +403,16 @@ class MysqlConnector extends AdminForthBaseConnector implements IAdminForthDataS
403403 let medianQuery : string ;
404404 if ( groupExpr ) {
405405 medianQuery = `
406- SELECT ${ groupExpr } AS \`group\`, AVG(${ f } ) AS \`${ alias } \`
406+ SELECT \`group\`, AVG(${ f } ) AS \`${ alias } \`
407407 FROM (
408- SELECT ${ groupExpr } , ${ f } ,
408+ SELECT ${ groupExpr } AS \`group\` , ${ f } ,
409409 ROW_NUMBER() OVER (PARTITION BY ${ groupExpr } ORDER BY ${ f } ) AS rn,
410410 COUNT(*) OVER (PARTITION BY ${ groupExpr } ) AS cnt
411411 FROM \`${ tableName } \` ${ nullGuard }
412412 ) t
413413 WHERE rn IN (FLOOR((cnt + 1) / 2.0), CEIL((cnt + 1) / 2.0))
414- GROUP BY ${ groupExpr }
415- ORDER BY ${ groupExpr } ASC
414+ GROUP BY \`group\`
415+ ORDER BY \`group\` ASC
416416 ` ;
417417 } else {
418418 medianQuery = `
You can’t perform that action at this time.
0 commit comments