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
Subin Thomas
NA
4.9k
127.1k
sql query related !
Mar 26 2019 4:00 AM
i have a table like below
name1
name2
amount1
amount2
aa
111
100
200
aa
111
200
300
aa
111
0
100
aa
111
250
350
bb
222
150
0
bb
222
300
400
cc
333
0
200
cc
333
350
0
here the name aa is repeated also 111 but the amounts are not repeated it is different
i want the repetative names as one record and the amount should be the sum
for eg i want the above table as the below table
name1
name2
amount1
amount2
aa
111
550
950
bb
222
450
400
cc
33
350
200
Reply
Answers (
6
)
dont want records which has 0 amount in it in sql !
how to show only records having value >0 in sql ?