DECLARE @Names VARCHAR(8000)
SELECT @Names = COALESCE(@Names + ''', ''', '''') + makien
FROM tbl_phieuyeucau_nhapkho WHERE nguoinhan='nguyenthao' and makien not in (select makien from tbl_phieunhapxuat where nguoitd='NGUYENTHAO' AND LOAIPHIEU='N')
print @names + '''';