paulsteigel > 09-09-13, 04:46 PM
Shigeshi Hitoshi > 10-09-13, 09:57 AM
Shigeshi Hitoshi > 10-09-13, 03:13 PM
bomnhauag > 10-09-13, 03:21 PM
Shigeshi Hitoshi > 10-09-13, 03:42 PM
INSERT INTO HoaDon(SoHD,NgayNhan,TenKhachHang,MST,MatHang,GiaChuaThue,ThueSuat,Thue,GhiChu,LoaiHD)
SELECT F21, F22, F23, F24, F25, F26, F27, F28, F29,F30
FROM Journal_Import
WHERE Journal_Import.F21;
Shigeshi Hitoshi > 10-09-13, 04:04 PM
INSERT INTO HoaDon ( SoHD, NgayNhan, TenKhachHang, MST, MatHang, GiaChuaThue, ThueSuat, Thue, GhiChu, LoaiHD )
SELECT F21, F22, F23, F24, F25, F26, F27, F28, F29, F30
FROM Journal_Import
WHERE NOT EXISTS (SELECT SoHD
FROM HoaDon
WHERE HoaDon.SoHD = Journal_Import.F21);
Shigeshi Hitoshi > 10-09-13, 05:35 PM
bomnhauag > 11-09-13, 09:17 AM
(10-09-13, 04:04 PM)Shigeshi Hitoshi Đã viết: Mình mới mò ra cái code này mọi người giúp mình làm như vậy có đúng không nha thank
Mã:INSERT INTO HoaDon ( SoHD, NgayNhan, TenKhachHang, MST, MatHang, GiaChuaThue, ThueSuat, Thue, GhiChu, LoaiHD )
SELECT F21, F22, F23, F24, F25, F26, F27, F28, F29, F30
FROM Journal_Import
WHERE NOT EXISTS (SELECT SoHD
FROM HoaDon
WHERE HoaDon.SoHD = Journal_Import.F21);
INSERT INTO HoaDon ( SoHD, NgayNhan, TenKhachHang, MST, MatHang, GiaChuaThue, ThueSuat, Thue, GhiChu, LoaiHD )
SELECT F21, F22, F23, F24, F25, F26, F27, F28, F29, F30
FROM Journal_Import
WHERE NOT EXISTS (SELECT SoHD FROM HoaDon);
Shigeshi Hitoshi > 11-09-13, 02:42 PM
SELECT F21, F22, F23, F24, F25, F26, F27, F28, F29, F30
FROM Journal_Import
WHERE Journal_Import.F30;
INSERT INTO HoaDon ( SoHD, NgayNhan, TenKhachHang, MST, MatHang, GiaChuaThue, ThueSuat, Thue, GhiChu, LoaiHD )
SELECT F21, F22, F23, F24, F25, F26, F27, F28, F29, F30
FROM Journal_Import
WHERE NOT EXISTS (SELECT SoHD FROM HoaDon);
Shigeshi Hitoshi > 11-09-13, 03:19 PM
INSERT INTO HoaDon( SoHD, NgayNhan, TenKhachHang, MST, MatHang, GiaChuaThue, ThueSuat, Thue, GhiChu, LoaiHD )
SELECT F21, F22, F23, F24, F25, F26, F27, F28, F29, F30
FROM Journal_Import
WHERE Journal_Import.F30 AND NOT EXISTS (SELECT SoHD FROM HoaDon);