Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using SQL in RPG

Status
Not open for further replies.

ndevriendt

Programmer
Jan 8, 2002
74
0
0
BE
Is it possible to use the following statement in SQL/400 ?

Select Top 5 * from FileX

I want to select only the first 5 records from my table

Thanks for your time and answer

Nico
 
I have found it on my own

I'm using now Fetch First 5 Rows Only

thx for reading my question

Nico
 
Hi,

You can, in sqlrpg, enter the next code :

SELECT * from MyLib/MyTable
where RRN(MyTable) <= 5.


Sql will return you the 5 first record of the file.



By.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top