I have a table that contains dated transactions that include Debits and Credits. There are also fields that designate particular types of transactions, e.g., "Type" (Integer).
I'd like to have a query that returns the difference between the total of Debits and Credits for a given "Type" of transaction. Like Bal AS (SUM(Credits) - SUM(Debits))
What would be the SELECT statement be for something like this?