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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How you select Top n from Informix query SQL

Status
Not open for further replies.

zishan619

Programmer
May 28, 2003
284
MX
Hi:
I have a query which needs to select the last person who worked on an account. So my SQL query is
SELECT TOP 1 work_actions.RACF, work_actions.date_time_posted FROM work_actions
ORDER BY work_actions.date_time_posted DESC
It is giving me a syntax error?
 
Hi,

Make use of FIRST keyword, and the modified SQL looks as below:

SELECT FIRST 1 racf, date_time_posted
FROM work_actions
ORDER BY date_time_posted DESC

Regards,
Shriyan

"The value of a program is proportional to the weight of its output."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top