Re: SQL Question
Posted in 1997
vfraenkle@aol.com wrote: { Im Artikel <32C9ADCB.7F63@qualcomm.com>, Tin Zaw <tzaw@qualcomm.com> { schreibt: { >Does any one know how to do following in SQL (Informix in particular)? { > { >I need to get the first row a SELECT statement finds, not all the rows. { > { >e.g. SELECT * from my_table where row_value < 10 .... { > { >should return first row with row_value < 10, even the table has { >many qualifying rows. { > { > { Try this: { select * from my_table where rowid < { (select min (rowid) from my_table) + 10; [See my previous post for a working select] THis would only give the same row every time. 10 Rows after the lowest rowid in the table. -- gburnore@databasix.com mailto:gburnore@databasix.com --------------------------------------------------------------------------- This sig will self distruct. --------------------------------------------------------------------------- Gary L. Burnore | '۳''''''۳'''''''''''۳ DataBasix | '۳''''''۳'''''''''''۳ San Francisco, CA | '۳''''''۳'''''''''''۳ | '۳ 3 4 1 4 2 '' 6 9 0 6 9 '۳ http://www.databasix.com | Official Proof of Purchase ===========================================================================