SQL equivalent of TOP?

Veng-Ly Tong

New Member
Does anyone know of the Progress SQL equivalent of the TOP keyword in SQL Server?

Specifically, I'm trying to make a similar query to just get the first N records:
select top 10 <fieldname>
from <tablename>


Thanks.
 

Veng-Ly Tong

New Member
Thanks for your reply, Mike. The TOP-N function is also found in MS Access, Oracle, and mySQL so it's a somewhat common functionality across a number of databases, although it may be called different function names. I'll look into your link.

Whatever the case, if you wanted to only retrieve the first N number of records of a query, how would you write a Progress query to do that without writing up a stored procedure or view?

Thanks!


Mike Carroll said:
TOP may just be an extension to SQL that exists in SQL Server. Have a look through the Progress docs. You can find them here:

http://www.progress.com/products/documentation/index.ssp
 
Sorry - I don't know.

Even though TOP-N is "standard", if it doesn't form part of the SQL standard then it's unlikely to be in the Progress version. SQL isn't the primary means of accessing data in a Progress database - the 4GL is. Progress marketing can just "tick a box" when they say that their database is SQL compliant - and they're probably right. It is compliant, but don't expect any extras.

You may want to re-post this question in the SQL-92 forum on ProgressTalk. There may be some real SQL experts hanging around who can help.
 
Top