Re: How to limit rows selected?
Posted in 1997
Alternatively, get a Query Tool such as IQ which has rows returned 'choke' parameter. Errol In <FCFA30C218FB776D.A1D069F478AE78B8.06FDD368E7BB0CF6@library-proxy.airne s.net> Hari Muthuswamy <hkmtsr1@airmail.net> writes: > >Arun, > >One way to do it would be through esqlc, where you can >define a cursor(main) to fetch records from the main table containing >the names of the sub table. Define another cursor(sub) to get records >meeting the necessary selection criteria. Then the pseudo code >would be : > > until EOF > fetch from main cursor > for(i=0;i< 51;i++) > fetch from sub cursor > if EOF > break; > insert the values fetched into temporary table; > >Now, you can run a direct select from the temporary table. >Note: This might NOT be an optimum way to do it. > > >Hari > > > > >Arun Jamwal wrote: >> >> Hi everyone! >> >> What's the optimum way to extract say, 50 , rows from >> say, 100 customer data tables - the table names are not >> known until runtime, ie, a separate table contains the >> names of these 100 customer data tables? Each customer >> data table may contain 1000+ records/rows. >> >> The 50 rows fetched/selected must be the ones which have >> say, the lowest age among all the records in 100 customer >> data tables. >> >> Thanks in advance. >> >> Jamwal. >> Email: jamwal@quality.com