Django,MSSQL Server查询和分页
这是我的MSSQL Server表的一个示例
,现在可以在我的应用程序前页面中使用
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
,其中有一个表,其中每个员工都在表中列出了一次,并且扩展每个员工将显示他们的所有可用状态。我曾尝试使用pyodbc
来获取:
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
因此,我们如何使用分页,考虑到大约有200k的记录和大约100万个不同的员工
This is a sample of my MSSQL server table
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
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有两种方法可以做到这一点:
1。流行加载
There are two approaches to do it:
1.lazy loading