Display the total debit counts, total credit counts, sum of
total debits, sum of total credits from an employee's
transaction table (a single table) containing the following
columns.
Transaction_number
Transaction_amount
Transaction_date
Transaction_type --> tells if the amount is a credit or a
debit.
As the query alone is important, the table is left with
specifying just the field's name. Pls help me with this
query.
Answer Posted / ajit
Also u can use count function to calculate total debit & credit cout.
and u can use this sql stmt
select tran_type, Count(tran_type) total,
(select sum(tran_amt)
from tran
where tran_type = 'D') sumofde,
(select sum(tran_amt)
from tran
where tran_type = 'C') sumofce
from tran
group by tran_type;
| Is This Answer Correct ? | 0 Yes | 10 No |
Post New Answer View All Answers
what is union? : Sql dba
How many triggers can be applied on a table?
Describe sql comments?
How to avoid using cursors? What to use instead of cursor and in what cases to do so?
what is sub-query? : Transact sql
What is difference between cursor and trigger?
What type of database is cloud sql?
what are all the different types of indexes? : Sql dba
What is the most important ddl statements in sql are?
What are the different types of constraints?
Can you skip header records while loading? : aql loader
What is sql exception?
What is microsoft t sql?
Is time a data type in sql?
What is execute immediate?