I have the following nested query. The second select sum(amount) works by itself. But, the whole query not working. Please help. Thanks.
SELECT *
FROM (select sum(amount) amount, leaseid, accntyearmonth, loscode from leaselos where specialtype='Net' group by leaseid, loscode,accntyearmonth )
SELECT *
FROM (select sum(amount) amount, leaseid, accntyearmonth, loscode from leaselos where specialtype='Net' group by leaseid, loscode,accntyearmonth )