nguyenngoclam > 26-02-21, 07:21 PM
ongke0711 > 27-02-21, 12:12 AM
SELECT Hoa_don.So_don, Sum([So_luong]*[Don_gia]) AS ThanhTien
FROM Hoa_don INNER JOIN Mat_hang ON Hoa_don.Ma_mat_hang = Mat_hang.Ma_mat_hang
GROUP BY Hoa_don.So_don;
SELECT Hoa_don.Ma_khach_hang, Khach_hang.Ho_ten, Hoa_don.So_don, Sum([So_luong]*[Don_gia]) AS Thanh_tien, Hoa_don.Ngay_giao_hang
FROM (Hoa_don INNER JOIN Khach_hang ON Hoa_don.Ma_khach_hang = Khach_hang.Ma_khach_hang) INNER JOIN Mat_hang ON Hoa_don.Ma_mat_hang = Mat_hang.Ma_mat_hang
GROUP BY Hoa_don.Ma_khach_hang, Khach_hang.Ho_ten, Hoa_don.So_don, Hoa_don.Ngay_giao_hang;
SELECT Hoa_don.Ma_khach_hang, Khach_hang.Ho_ten, Sum([So_luong]*[Don_gia]) AS Thanh_tien
FROM (Hoa_don INNER JOIN Khach_hang ON Hoa_don.Ma_khach_hang = Khach_hang.Ma_khach_hang) INNER JOIN Mat_hang ON Hoa_don.Ma_mat_hang = Mat_hang.Ma_mat_hang
GROUP BY Hoa_don.Ma_khach_hang, Khach_hang.Ho_ten;