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
Dorababu Meka
230
8.3k
1.7m
Need Help in solving SQL QUERY
Jul 30 2011 3:08 AM
I have my table data as follows
EMPID
FedTaxID
TaxType
Amount
1059
888888888
TX02
2000
1059
888888888
TX02
1000
1059
888888888
TX03
2000
I write a query to sum up the amount as follows
select SUM(Amount)
FROM
tblTest
WHERE
FedTaxID = '888888888'
AND
TaxTypeCode IN ('TX02', 'TX03')
But what i need is if TX03 exists 1 in the table i would like to add the amount multiple times means if i sum the total i will get 5000 but i would like to get 7000. If TX03 exists 1 time in the table i would like to add multiple times any idea please
Reply
Answers (
14
)
About sql server stored procedure for updating serial no column
How to add child table rows as columns to the parent table?