in account table
account type amount
ac1 credit 300
ac2 debit 5000
ac3 credit 3000
ac1 debit 4000
ac3 debit 2000
ac2 credit 4000
write a query how to get sum of credit & sum of debit

Answer Posted / kamala k n

select type, sum(amount) over (partiton by sid) from tab

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the uses of Database Trigger ?

1105


What are the general rules on data consistency?

589


Tab A A B ------ 1 A 2 B 3 C Tab B A B ----- 4 D 5 E 6 F Generate the value into B table from A table. Only table A has the value. Write the SQL query to get B table value.

1262


How to connect asp pages to oracle servers?

577


What is pragma autonomous transaction in oracle?

520






Explain the use of ignore option in imp command.

577


How can I convert single byte kana characters into multi byte kana characters and vice-versa.

1936


How to get execution path reports on query statements?

566


How to use subqueries in the from clause in oracle?

582


What is private procedure oracle?

531


How to resolve name conflicts between variables and columns?

574


How to convert dates to characters in oracle?

584


How to use an explicit cursor without open statements?

616


How to create a table index?

568


Can we store pictures in the database and if so, how it can be done?

593