Jim Suppose you want to SELECT 10 per page:
Page 1 SELECT * FROM main WHERE gallery='y' AND COUNT >= 1 and COUNT <= 10 ORDER BY last_name Page 2 SELECT * FROM main WHERE gallery='y' AND COUNT >= 11 and COUNT <= 20 ORDER BY last_name You MIGHT have to first create a view of the rows in the right order, then select from the view. David Blocker [EMAIL PROTECTED] 781-784-1919 Fax: 781-784-1860 Cell: 339-206-0261 ----- Original Message ----- From: "James Hageman" <[EMAIL PROTECTED]> To: "RBG7-L Mailing List" <[email protected]> Sent: Friday, July 08, 2005 11:01 AM Subject: [RBG7-L] - Re: Tip of the Day: Assigning Line Numbers for theSELECTCommand (order by fails) > Yeah that is neat, except when I try to use an ORDER BY at the end, > 'ROWCOUNT' stops counting and gets set to the total count for each row. > I was hoping this would solve a problem I have been having ... > > I am trying to convert a php/mysql web page to php/oterro. Mysql allows > LIMITS in SELECTS statements i.e. > > $limit = 5; > $limitvalue = 5; > $query = "SELECT * FROM main WHERE gallery='y' ORDER BY last_name LIMIT > $limitvalue, $limit"; > > I use this for pagination. > > Someone think of a way to convert this to rbase friendly? > > Jim > > > > > > > > > > > David M. Blocker wrote: > > >Cool tip, Razzak! > > > >David > > > >David Blocker > >[EMAIL PROTECTED] > >781-784-1919 > >Fax: 781-784-1860 > >Cell: 339-206-0261 > >----- Original Message ----- > >From: "A. Razzak Memon" <[EMAIL PROTECTED]> > >To: "RBG7-L Mailing List" <[email protected]> > >Sent: Friday, July 08, 2005 3:51 AM > >Subject: [RBG7-L] - Tip of the Day: Assigning Line Numbers for the SELECT > >Command > > > > > > > > > >>Friday, July 8, 2005 > >> > >>Tip of the Day: Assigning Line Numbers for the SELECT Command > >> > >>Did you know that you can assign the line numbers for the > >>SELECT command? > >> > >>Use the (CVAL('ROWCOUNT')) function to achieve that goal. > >> > >>Here's how: > >> > >>01. Start R:BASE 7.x or R:BASE V-8 "Turbo" for Windows > >> > >>02. CONNECT ConComp > >> > >>03. At the R> Prompt: > >> > >> SELECT (INT(CVAL('ROWCOUNT'))) AS LineNo,Company=30, + > >> (CustCity+','&CustState&CustZip) AS CityStateZip FROM Customer > >> > >> Notice the line counter! > >> > >>04. If you would like to print that select statement output as PDF, > >> use the following example: > >> > >> SET VAR vLines = (INT(CVAL('LINES'))) > >> SET LINES 0 > >> OUTPUT CustomerList.PDF PDF > >> SELECT (INT(CVAL('ROWCOUNT'))) AS LineNo,Company=30, + > >> (CustCity+','&CustState&CustZip) AS CityStateZip FROM Customer > >> OUTPUT SCREEN > >> SET LINES .vLines > >> > >> That will send the output as CustomerList.PDF using the > >> "built-in" PDF capabilities of R:BASE OUTPUT command. > >> > >> Use the LAUNCH CustomerList.PDF command to view the results. > >> > >>That's all there is to it! > >> > >>Very Best R:egards, > >> > >>Razzak. > >> > >> > >> > >> > >> > > > > > > > > >
