RE: How to select first 50 rows?
Posted in 2003
Not one of the easiest things to do! Best way I have heard of is to select all your results into a temporary table with a serial field then use this to select records 1-50 (using the serial field) for page 1, records 51-100 for page 2, records 101-150 for page 3 etc. It does mean your first page may take rather longer to generate, having to retrieve the full results set first, but does allow you to page forward and backward through the results set using simple, quick queries from the temp table. Keith -> -----Original Message----- -> From: miyaki [mailto:lcib@yahoo.com] -> Sent: Wednesday, October 29, 2003 8:49 AM -> To: informix-list@iiug.org -> Subject: RE: How to select first 50 rows? -> -> -> The FIRST function will only selecting the first 50 -> rows. What if i want to select the next 50 rows? -> Actually what i'm looking at is a sql that able to -> return me every 50 rows of records at one time. -> -> Thanks for the helps. -> -> Miyaki -> -> --- Dirk Moolman <DirkM@mxgroup.co.za> wrote: -> > -> > select first 50 * -> > from <your_table> -> > -> > -> > -> > -----Original Message----- -> > From: miyaki [mailto:lcib@yahoo.com] -> > Sent: Wednesday, October 29, 2003 3:52 AM -> > To: ids@iiug.org; informix-list@iiug.org -> > Subject: How to select first 50 rows? -> > -> > Hi guys, -> > -> > If i have a total 500 rows of records set, but i -> > need -> > to return 50 rows at one time by a sql statement. Do -> > you know how to do that? -> > -> > Thanks in advance. -> > -> > Miyaki -> > -> > __________________________________ -> > Do you Yahoo!? -> > Exclusive Video Premiere - Britney Spears -> > http://launch.yahoo.com/promos/britneyspears/ -> > sending to informix-list -> -> -> __________________________________ -> Do you Yahoo!? -> Exclusive Video Premiere - Britney Spears -> http://launch.yahoo.com/promos/britneyspears/ -> sending to informix-list -> ********************************************************************************** This message is sent in strict confidence for the addressee only. It may contain legally privileged information. The contents are not to be disclosed to anyone other than the addressee. Unauthorised recipients are requested to preserve this confidentiality and to advise the sender immediately of any error in transmission. This footnote also confirms that this email message has been swept for the presence of computer viruses, however we cannot guarantee that this message is free from such problems. ********************************************************************************** sending to informix-list