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
how to return query output in html format? : Sql dba
What is sql indexing?
What is the need of merge statement?
How to display the current date in sql?
What is a .db file?
Does asenumerable execute the query?
What is record data type?
What is the difference between a database and a relational database?
What is rank dense_rank and partition in sql?
What is sql used for?
What is relationship? How many types of relationship are there?
What is the use of index in hive?
What is group by in sql?
How do I view a procedure in sql?
what are the differences between procedure-oriented languages and object-oriented languages? : Sql dba