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
836
986
147.8k
Question Query why not group ?
Aug 18 2017 2:57 AM
I have the following query, to group the records but not the group was thanks to you only help, the end when running excel file view:
SELECT TOP (100) PERCENT dbo.TABNHANVIENCA.CANV, dbo.TABHDBHCT.TENSP, dbo.TABDONVI.TENDVT, SUM(dbo.TABHDBHCT.SOLUONG) AS SL, SUM(dbo.TABHDBH.DOITRA) AS DTRA, dbo.TABHDBHCT.GIABAN AS DONGIA, CASE TABHDBH.DOITRA WHEN 0 THEN (TABHDBHCT.SOLUONG * TABHDBHCT.GIABAN) ELSE (TABHDBHCT.SOLUONG - TABHDBH.DOITRA) * (TABHDBHCT.GIABAN) END AS THANHTIEN, dbo.TABHDBHCT.GIABAN * dbo.TABHDBHCT.GIAMGIA / 100 AS GGIA, CASE TABHDBH.DOITRA WHEN 0 THEN (TABHDBHCT.SOLUONG * TABHDBHCT.GIABAN) - (dbo.TABHDBHCT.GIABAN * dbo.TABHDBHCT.GIAMGIA / 100) ELSE ((TABHDBHCT.SOLUONG - TABHDBH.DOITRA) * (TABHDBHCT.GIABAN)) - (dbo.TABHDBHCT.GIABAN * dbo.TABHDBHCT.GIAMGIA / 100) END AS TONGCONG, dbo.TABCUAHANG.TENCUAHANG FROM dbo.TABHDBH INNER JOIN dbo.TABHDBHCT ON dbo.TABHDBH.IDHDBH = dbo.TABHDBHCT.MAHDBH INNER JOIN dbo.TABCUAHANG ON dbo.TABHDBHCT.MACUAHANG = dbo.TABCUAHANG.IDCUAHANG INNER JOIN dbo.TABDONVI ON dbo.TABHDBHCT.MADVT = dbo.TABDONVI.IDDVT INNER JOIN dbo.TABNHANVIENCA ON dbo.TABHDBH.MACA = dbo.TABNHANVIENCA.IDCANV WHERE (dbo.TABHDBH.NGAY BETWEEN '07/01/2017' AND '08/18/2017') AND (dbo.TABCUAHANG.TENCUAHANG = N'C?a hàng nha trang') AND (dbo.TABHDBH.TTTHANHTOAN >= 0) AND (dbo.TABHDBH.TTTHANHTOAN <= 2) GROUP BY dbo.TABNHANVIENCA.CANV, dbo.TABHDBHCT.TENSP, dbo.TABDONVI.TENDVT, dbo.TABHDBHCT.SOLUONG, dbo.TABHDBH.DOITRA, dbo.TABHDBHCT.GIABAN, dbo.TABHDBHCT.GIAMGIA, dbo.TABCUAHANG.TENCUAHANG ORDER BY dbo.TABNHANVIENCA.CANV DESC, dbo.TABHDBHCT.TENSP
http://www.mediafire.com/file/ezwbitr7a2gjzve/sSQLNhom.xls
Reply
Answers (
2
)
Is it possible go from .net to AI
Read bullet from Word File