cancel
Showing results for 
Search instead for 
Did you mean: 

FIORI CAP Function Select groupBy with alias

glauco
Active Contributor
0 Kudos

Hi.
I'm looking for an example on how to use groupBy using a field alias "as".
Didn't find yet or I did not understand how it work.

Any example pls ?

View Entire Topic
glauco
Active Contributor
0 Kudos

Hi I found out.

const oSelect = await db.run( SELECT.columns(["left(cpuDt,7) as mes", "COUNT(*) as count"]) .from(MY_TABLE) .where `cpuDt between ${dtFiltroInicial} and ${dtFiltroFinal}` .limit(1001) .groupBy("left(cpuDt,7)") .orderBy({'left(cpuDt,7)': 'asc'}) )