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!

MSSQL TOP n equivalent for Informix?

Status
Not open for further replies.

AoN

Programmer
Oct 19, 2001
12
SE
I'm working on an application which will work against several DBMS's. I've found that if I use the MSSQL specific TOP n in one of my queries I cut time to a third.

I've been looking for an equivalent that for INFORMIX.

Basically it returns either the TOP n percent, or the TOP n rows. I need something that returns only 1 row, as TOP 1 would do.

Is there a equivalent thing for INFORMIX?


Bless!

AoN
 
Hi:

Check the documentation on the informix select clause. New, with the 7.x engine, you can do something like this:

selct FIRST 2 {+FIRST_ROWS} * from some_table
where some_column = "some_value"

The above gets the first two rows.

regards,


Ed
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top