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 compiled query?
What are different clauses used in sql?
how to calculate expressions with sql statements? : Sql dba
What is user defined functions?
Describe sql comments?
What are string functions in sql?
Is a foreign key always unique?
What is nosql vs sql?
Explain aggregate functions are available there in sql?
what are the differences between char and nchar? : Sql dba
What are sql objects?
Is there a way to automate sql execution from the command-line, batch job or shell script?
How do I run a pl sql program?
Explain about various levels of constraint.
what are local and global variables and their differences? : Sql dba