<i>-select first five rows in a table</i><br>select top 5 * from mytable<br><br><i>-select last five rows</i><br>select top 5 * from mytable order by mycolumn desc<br><br>As to the other two, I can't think of anyway short of a stored procedure walking a cursor, absent some column in the table that would help (for example, an integer PK column). <p>Robert Bradley<br><a href=mailto: > </a><br><a href=
If you have a identity column(if using SQL Server) or Autoincrement column (if using MS Access). Retrieve this ID column by using a mod of 2. If the mod is 0 then that is even if mod is not 0 then it is odd. <br><br>In case you don't know what MOD is, it is the remainder of division. So you would have to loop through the recordset, do ID MOD 2, if the answer is 0 (this is your even record) and if the answer is NOT 0 (this is your odd records). <br><br>LuvASP.
How to get the records between 5 and 10.?
For example,
If "select * from employee" is returing 100 records.
How to get the records from 5 to 10?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.