Re[2]: SQL Question
Posted in 1997
This is a Mime message, which your current mail reader
may not understand. Parts of the message will appear as
text. To process the remainder, you will need to use a Mime
compatible mail reader. Contact your vendor for details.
--IMA.Boundary.001242258
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Description: cc:Mail note part
}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;
}ciao volker
I think the easiest is:
select field12, field2, field3, ....
from mytable
where row_value < 10
into temp temp1;
select * from temp1 where rowid = 1;
Joe Hoin USA TACOM
--IMA.Boundary.001242258
}Content-Type: text/plain; charset=US-ASCII; name="RFC822 message headers"
}Content-Transfer-Encoding: 7bit
}Content-Description: cc:Mail note part
}
}Received: from octagon.tacom.army.mil by cc.tacom.army.mil with SMTP
} (IMA Internet Exchange 1.04b) id 2cc07320; Thu, 2 Jan 97 14:06:26 -0500
}Received: from rmy.rmy.emory.edu by octagon.tacom.army.mil (8.8.4/8.8.4-kbp) with
} ESMTP
} id NAA07201; Thu, 2 Jan 1997 13:52:48 -0500 (EST)
}Received: (from ilist@localhost) by rmy.rmy.emory.edu (8.7.1/8.7.1) id NAA11820 f
}or informix@tacom-emh1.army.mil; Thu, 2 Jan 1997 13:53:10 -0500 (EST)
}From: vfraenkle@aol.com
}Message-Id: <19970102170700.MAA16859@ladder01.news.aol.com>
}Subject: Re: SQL Question
}Date: 2 Jan 1997 17:09:05 GMT
}Reply-To: vfraenkle@aol.com
}Organization: AOL Bertelsmann Online GmbH & Co. KG http://www.germany.aol.com
}Sender: informix-list-owner@rmy.emory.edu
}To: informix-list@rmy.emory.edu
}X-Informix-List-To: informix@tacom-emh1.army.mil
}X-Informix-List-Id: <news.32133>
--IMA.Boundary.001242258--