> For the complete documentation index, see [llms.txt](https://kythuat.dtechvn.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kythuat.dtechvn.com/effect/kiem-tra-du-lieu.md).

# KIỂM TRA DỮ LIỆU

## 1. Kiểm tra nghiệp vụ có nhập nhiều ma\_kh không

```sql
/*
- nghiệp vụ có cột ma_kh ở dưới lưới dữ liệu
- kiểm tra xem có nhập nhiều ma_kh ở nghiệp vụ không
*/
-- kiểm tra khachhang trên 1 phiếu
select ngay_thc,chung_tu,count(*)
from
(
select ngay_thc,chung_tu, ma_kh
from _thu_tien where ma_scr=706
group by ngay_thc,chung_tu, ma_kh
) T group by ngay_thc,chung_tu
having count(*)>1
order by ngay_thc desc
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://kythuat.dtechvn.com/effect/kiem-tra-du-lieu.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
