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 posting?
What is flag in sql?
Why truncate is faster than delete?
Explain what is table in a database?
what is a trigger? : Sql dba
What is compiled query?
What does the file extension accdb stand for?
what is single byte over head in oracle..?
What is the maximum rows in csv?
How do I delete a trigger?
What is raid? How does it help storage of databases?
how to use regular expression in pattern match conditions? : Sql dba
Can we delete column in sql?
Do we need to create index on primary key?
What are the most important characteristics of pl/sql?