query wanted to retrieve record from table with known offset in mysql

35
June 08, 2021, at 03:10 AM

I am trying to write a query and fetch the records with some offset.

For Example - If I access the 1st record, along with that I require 5th Record should also be fetched..( Observe the Color codes in the above attachment)

If I access 2nd Record, then add (2+4)= 6th Record should also be fetched.

One solution is to retrieve with offset 1 to 5, and fetch the records 1st to 5th record and read only 1st record and last record from the result set..

Problem with this approach if the offset is more, in above case its 5, in real world scenario if the offset can be 1000.. fetching all the 1000+ records and reading 1st and last record woudl defnitely reduce the performance.. So I am looking for fetching directly 1st and nth offset record.

in the attached screen, fetch only 1st and 5th record..

READ ALSO
JupiterLab matplotlib line diagram is not mapped

JupiterLab matplotlib line diagram is not mapped

im trying to plot with matplotlib inJupiterLab a line graph:

57
Replace Build from docker-compose.yml with the built image once config is final?

Replace Build from docker-compose.yml with the built image once config is final?

I have a bunch of docker images and containers that I've been building with ayml file and Docker Files

42
How to solve race condition in Javascript? [closed]

How to solve race condition in Javascript? [closed]

Want to improve this question? Update the question so it focuses on one problem only by editing this post

45
Hide navigation arrows depending on the active class of children inside li

Hide navigation arrows depending on the active class of children inside li

I have run into a problem with a carousel which is not adding an active class to all of the li that he hasHowever, active class is added properly on the children of the li, depending on the left or right arrow click

40