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
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 |
What is a subquery in sql?
How do you use collections in procedure to return the resultset?
Source is Sales Table: Sno Prod Sales Sales_Amount 1 A 10 2000 2 A 20 1000 3 C 10 3000 4 D 30 4000 5 A 20 1000 Target : Sales_Count T_Sales_Amt Sales_Count(A) T_Sales_Amt(A) 90 11000 50 4000 In single query, pls tell me.
How do you update a sql procedure?
Can sql developer connect to db2?
Can there be 2 primary keys in a table?
What do you mean by stored procedures? How do we use it?
What are all the different normalizations?
Name Salary Abc 50000 Abc 50000 xyz 20000 find the max salary using aggregate function?
Does access use sql?
What is record in pl sql?
What is cursor and why it is required?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)