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
Dong Lam Trien
830
986
147.3k
query group and Sum number has got Conditional ?
Nov 27 2016 5:13 AM
I have the following SQL Server query:
requirements SUM and GROUP column SOLUONG AS SL , if TRAHANG = true then bring positive column opposite quantity quantity column value is negative, no team and no columns SL sum is, if I would give TRAHANG column in the SELECT statement error. Can you help me ?
[CODE]
//Query warning eror
SELECT TABHDBHCT.MAVACH_SP, TABHDBHCT.TENSP, SUM(TABHDBHCT.SOLUONG)*CASE WHEN [TRAHANG] = 0 THEN 1 ELSE -1 END AS SL
FROM TABHDBHCT INNER JOIN
TABHDBH ON TABHDBHCT.MASOPHIEU = TABHDBH.IDSOPHIEU
WHERE (TABHDBH.TTTHANHTOAN = 1 OR
TABHDBH.TTTHANHTOAN = 2) AND (TABHDBH.NGAY BETWEEN '11/01/2016' AND '11/30/2016')
GROUP BY TABHDBHCT.MAVACH_SP, TABHDBHCT.TENSP
ORDER BY TABHDBHCT.TENSP;
[/CODE]
Reply
Answers (
2
)
host a web aaplication into IIS
IIS Deployment of web app