How to get pagination in Teradata..??

Database

How to get pagination in Teradata..??

How to get pagination in Teradata..?? Its possible in Oracle but is there anyway to get the required amount of exact records in Teradata...?? Actually i need to get first 50 records during my first call to the database and then the next 50 records during my second call.. how is tat possible in Teradata..?? Please help..
1 REPLY
Enthusiast

Re: How to get pagination in Teradata..??

use rank function and use qualify to choose the results.

example:

my_customer is a table with cust_no as UPI

first hundred records can be got by this query:
select cust_no, name, rank(cust_no) as row_id
from my_customer
qualify row_id between 1 and 100;

change the row_id as per your requirement.