Re: SET ROWCOUNT -its a SYBASE command
Posted in 1997
Topics: SQL Development & Query Writing, Server Administration
}
} I beleive that 'set rowcount 50' is a perfecly valid SYBASE command, but not
} an INFORMIX command (too bad).
}
} I tried it on a 7.20UC2 server, and rcvd a syntax error.
}
} If I am wrong please correct me, I would like to know how INFORMIX
} supports this.
}
} Thanks,
}
} Spyro Svolos
} ssvolos@ual.com
} spyro@i-compute.com
} ----------
} From: informix-list-owner(a)rmy.emory.edu; nissim(a)magic-sw.com
} To: informix-list(a)rmy.emory.edu
} Subject: Re: How to limit rows selected?
} Date: Wednesday, July 09, 1997 1:30PM
}
} Glen Norman wrote:
}
} > 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
} > One way that may work for you is to use the statement "set rowcount
} > 50"
} > just before your select statement. Your select statement will do the
} > rest of the work. The select statement can have an order by or any
} > other clauses it needs. The rowcount limit is applied after
} > everything
} > else.
}
} set rowcount 50 ??????
} Is it "Informix" command ?
}
}
----------
From: informix-list-owner(a)rmy.emory.edu; tomasr(a)agcs.com
To: informix-list(a)rmy.emory.edu
Subject: Re: SET ROWCOUNT
Date: Wednesday, July 09, 1997 3:45PM
Sujit Pal wrote:
}
} Lately there has been some postings advising to SET ROWCOUNT n to get =
} the first n rows of a query, for example:
}
} SET ROWCOUNT 3;
} SELECT * FROM employee ORDER BY salary DESC;
}
} will return the top 3 earners in the database.
}
} I have been trying it on my databases here but it bombs out at ROWCOUNT =
} with a 201: Syntax Error has occured. I have 7.14.UD1 and 7.20.UC2 here =
} and they are both giving me errors. What version of dbaccess / isql is =
} this supported?
I believe the original post was cross-posted to both the Informix
and Sybase newsgroups. Perhaps the SET ROWCOUNT statement belongs
to Sybase?
-----------
Roger Tomas
AG Communication Systems