Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
4
Reply
Oracle - Sum in select query
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
Riddhi Valecha
9y
569
1
Reply
Hi all...
I have a query with the following output -
select E.EmpCode,
(select count (D.id) from Dept D where D.Location = E.Location) as "A"),
(select count (D.id) from Add D where D.Location = E.Location) as "B"),
(select count (D.id) from Dept D where D.DeptName = E.DeptName) as "C")
from Employees E
EmpCode
A
B
C
D=A+B-C
100A
2
4
7
2+4-7 = -1
101A
3
5
7
3+5-7 = 1
How to add one more column in this query and get the result - Row-wise total in "D" Column ??
Please guide and Help !
Thank a ton !
Post
Reset
Cancel
Answers (
4
)
Next Recommended Forum
DataGridView Error in Insert Statement
How to add temporary column in Sql Server