i have one table with accounts and amounts as
colums.accounts with columns c and d. and amounts with
values 1000,2000,3000 for c and 4000,5000,8000 for d.i need
to find the sum of these accounts c and d individually
and find the differences between their sum using one select
statement.

Answers were Sorted based on User's Feedback



i have one table with accounts and amounts as colums.accounts with columns c and d. and amounts wit..

Answer / sandeep

I hope this will be helpful.

SELECT sum(Account) as "Account Sum", sum(Amount) as "Amount
Sum", sum(Amount)-sum(Account) as "Difference" FROM account

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More SQL PLSQL Interview Questions

what are enums used for in mysql? : Sql dba

0 Answers  


Write a query to find the name of employees those who have joined on Monday.(based on column hire_date)

15 Answers   Satyam,


wt is the diff b/w greast and max ,least and min? wt is the diff b/w case and decod?

4 Answers   Oracle, TCS, Tecnics,


What is difference between triggers and stored procedures. And advantages of SP over triggers ?

4 Answers   Microsoft, TCS,


Can we use distinct and group by together?

0 Answers  






how to see the create table statement of an existing table? : Sql dba

0 Answers  


When we give SELECT * FROM EMP; How does oracle respond?

24 Answers   Accenture, HCL, Infosys,


what is “go” in t-sql? : Transact sql

0 Answers  


What is bulk compiling in pl/sql.?

0 Answers   MCN Solutions,


what is the bond code in materialized view?

0 Answers  


What are the types of functions in sql?

0 Answers  


What are the new features in Oracle 10g. Compared to Oracle 9i?

1 Answers   Polaris,


Categories