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 can we debug in PL/SQL?
What is view explain with example?
Does sql full backup truncate logs?
How can you tell the difference between an index and a view?
what are the drivers in mysql? : Sql dba
What is bulk collect in pl sql?
How to use distinct and count in sql query? Explain
How to create an array in pl/sql?
What is a sql select statement?
What is constant in pl sql?
can sql servers linked to other servers like oracle? : Sql dba
How to run sql*plus commands in sql developer?
How to select all records from the table?
What are sql commands?
Define tables and fields in a database