gsSQL icon indicating copy to clipboard operation
gsSQL copied to clipboard

Calculation using two AGGREGATE functions FAILS.

Open demmings opened this issue 1 year ago • 0 comments

The SUM() aggregate fields will return the correct values if used as the single source of info for the select field, but it fails when a calculation is done using the results of two or more aggregate functions. In this case it returns ONLY the sum of QUANTITY - and does not subtract the sum of PRICE.

        let stmt = "select sum(quantity) - sum(price) from booksales";

demmings avatar Aug 22 '24 04:08 demmings