I need to get the sum of amount field in a table which has the id in accoutgroupid in another table.
But, the following query returns error:
Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.
select sum(amount) from alltransaction where currency = 'USD' and accountid
in (select * from account where currency = 'USD' and accountgroupid = 0 and id > 0)