[英]Django,MSSQL server query and pagination
This is a sample of my MSSQL server table这是我的 MSSQL 服务器表的示例
Employeetable员工表
emp_id name status
EMP001 A STATUS-A
EMP001 A STATUS-B
EMP002 B STATUS-C
EMP001 A STATUS-D
EMP002 B STATUS-D
EMP003 C STATUS-C
Now in my app front end page there is a table in which each employee is listed once in the table and expanding each employee will show their every available status.现在在我的应用程序前端页面中有一个表格,其中每个员工都在表格中列出一次,展开每个员工将显示他们的每个可用状态。 I had tried to fetch using pyodbc
我曾尝试使用 pyodbc 获取
For Example:例如:
EMPID NAME
EMP001 A
---STATUS-A #After expanding the EMP001 row it shows all the status of EMP001
---STATUS-B
---STATUS-D
EMP002 B
EMP003 C
So how can we use pagination in this consider there are about 200K records and about 100K distinct employees那么考虑到大约有 20 万条记录和大约 10 万不同的员工,我们如何在此使用分页
There are two approaches to do it:有两种方法可以做到这一点:
1.lazy loading 1.懒加载
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.