Pervasive 11 "Top" or "First"

I am trying to pull the top, or first, record from a table... how can I do this in Perv 11?

Thanks
Sheldon LivingstonConsultantAsked:
Who is Participating?
 
Bill BachPresidentCommented:
SELECT TOP 1 * FROM TableName
0
 
mirtheilCommented:
Pervasive v11 supports the TOP keyword.  You would need to add an ORDER BY to sort on the field you want for the first record.  

For example, this query will return the first record from the Class table sorted by the Start_Date:
select top 1 * from class order by start_date

Open in new window

0
 
Sheldon LivingstonConsultantAuthor Commented:
Does this infer that you CANNOT specify the field?

select top 1 FRDATE from class order by start_date
0
 
mirtheilCommented:
Specifying the field in the select list will only return that field.
"select top 1 FRDATE from class"
will only return the first value for FRDATE.
0
 
Sheldon LivingstonConsultantAuthor Commented:
Thanks for you help!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.