TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
bubai banerjee
NA
24
0
Display report in SQL server 2012
Jun 13 2017 3:54 AM
I have a sql server table TestInsertState.
AppliedFor
Node
Amount
Delay Condonation NOC
3
300
Delay Condonation NOC
5
700
Mortgage NOC
1
400
Mortgage NOC
4
200
Delay Condonation NOC
8
400
Delay Condonation NOC
10
300
Mortgage NOC
12
100
Mortgage NOC
11
200
i want to display a report that show in below. I am using sqlserver 2012 and i am very new in sql server.if possibe please reply.Thanks in advance
if Node in(3,5,1,4) then 'MTS-1' and if Node in(8,10,11,12) then 'MTS-3'
Mts-1
Mts-3
AppliedFor
Amount
Amount
Delay Condonation NOC
1000
700
Mortgage NOC
600
300
What I have tried:
select sum(Amount)=
case when TestInsertState.NODE in(1,2,3,4,5,6,7) then 'MTS-1'
when TestInsertState.NODE in(8,9,10,11,12,13) then 'MTS-3'
end ,AppliedName
from TestInsertState
group by AppliedName
Reply
Answers (
2
)
error in reading table from a sql database C#
Replace nulls in column with Auto Increment by number