Data de postagem: May 18, 2010 9:12:57 PM
includeOnce -1897036629 /* /products/INTEQerp infrastructure/library/iQuery/IQuery.ijs */
IQuery.from( -2008889000 /* Títulos */ )
.column({ field: "CHAVE" })
.column({ count: "CHAVE", alias: "QTDE", distinct: true })
.toSql()
SQL Gerado:
select TITULO18.CHAVE, count(distinct(coalesce(TITULO1.CHAVE, 0))) as QTDE
from TITULO TITULO18
where (
TITULO18.CLASSE in (-2008889000,-2008888890,-2008888790,-1899998525,-1899998524,-1899998370,-1899998369,
-1899998367,-1899933806,51518,51519,35337524,35337539,35337623,35337638))
group by TITULO18.CHAVE