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


Please Help Members By Posting Answers For Below Questions

How can we debug in PL/SQL?

655


What is view explain with example?

517


Does sql full backup truncate logs?

527


How can you tell the difference between an index and a view?

489


what are the drivers in mysql? : Sql dba

552






What is bulk collect in pl sql?

529


How to use distinct and count in sql query? Explain

604


How to create an array in pl/sql?

580


What is a sql select statement?

563


What is constant in pl sql?

515


can sql servers linked to other servers like oracle? : Sql dba

550


How to run sql*plus commands in sql developer?

589


How to select all records from the table?

605


What are sql commands?

501


Define tables and fields in a database

644