mercredi 17 février 2016

subtract values in sqlite

I want to subtract values of two sums of two columns on the same table. Ej:

select DOMAINID, sum(MAXIMO), sum(MINIMO)
from TU_MEMORIA_SERVIDOR_HIS;

APLICACION|SUM(MAX) |SUM (MIN)
APLICACION|177862176|175412792

So that the output looks like this:

APLICACION|SUM(MAX) |SUM(MAX)-SUM(MIN)
APLICACION|177862176|2449384

Thank you!

Aucun commentaire:

Enregistrer un commentaire