Jump to content

SQL help: Select multiple rows on each db execute


Recommended Posts

So i have this huge database, i want a dbExec command to select the first 5 rows on each time its called, 5 different rows of course, I've tried Limit, Count, not sure if MTA SQL has Row_number, but anyway, any ideas?

Example:

First call :

row 1

row 2

row 3

row 4

row 5

Second Call:

row 6

row 7

row 8

row 9

row 10

and so on

Link to comment
For the first 5, append: "LIMIT 0, 5"

For the second 5, append: "LIMIT 5, 5"

The first one is the start at index, 0 is the first row, 5 is the 6th row. The second one is the number of rows to get.

Worked like charm!. However, if i wanted to iterate this, should i just increment both of numbers? Limit i+=5 , j+=5 ?

EDIT: Figured it out, thanks, motshakkren ya '3ali

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...