TransWikia.com

SQL Query for Pagination

Stack Overflow Asked by Abbas on November 12, 2021

I have students data for their fees paid for each program, now I want to show the outstanding fees, now since it’s possible student could have their outstanding fees for 2018, 2019 and 2020 pending, hence it will have 3 rows (The months will be in columns). Now since the student is same, I will be clubbing the records in the front end, now if I consider pagination and I have 10 per page limit, and in these 10 records 3 records is of the same student (since year was different), in that case I will end up having just 7 records on given page.

Here’s the sample data.

Studentname         RollNo    Year    Program     Jan  Feb  Mar  Apr  May  Jun ...
abc                 1         2018    p1          200   50   10   30   88   29
abc                 1         2019    p1          100   10   20   50   12   22
abc                 1         2020    p1          30    77   33   27   99   100
xyz                 2         2020    p2          88    29   32   99   199  200

How could I manage pagination for above case.

One Answer

Assuming your front end is HTML/CSS/Javascript:

You don't need to handle pagination in your query - or even your backend - at all. Everything can and should be done on your frontend. I would suggest using JQuery and Bootstrap to create a paginated table to display your data using Material Design for Bootstrap

Answered by stonkilla4 on November 12, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP