# KIỂM TRA TÀI KHOẢN CÓ LỖI TRÊN DULIEUKETOAN

## 1. Kiểm tra

* Tài khoản không tồn tại
* Tài khoản hạch toán vào cấp mẹ

```sql
// Some code
select  t1.tkno,t2.ma, t2.ten
from 
(select tkno from vr group by tkno)T1
full outer join
(select * from taikhoan) t2 
on t1.tkno = t2.ma
where 
t2.ma is null  -- tài khoản không tồn tại trên danh mục tài khoản
or (t2.Cap=1 and t2.ma = t1.TKNO) -- tài khoản hạch toán vào mã mẹ
--or t1.TKNO is null
order by t1.tkno
```


---

# Agent Instructions: 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/danh-muc/kiem-tra-tai-khoan-co-loi-tren-dulieuketoan.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.
