Re: Limiting # rows returned by SQL query - during te
Posted in 1995
Topics: SQL Development & Query Writing
billy.wheeler@digitec.co.za (Billy Wheeler) writes: >> In INFORMIX, I've always used 'where table.rowid < NNN'. >Yeah, it's just that in OnLine, rowid doesn't start at 1... I know, but it's the best I could think of at the time, and I've not found anything better. >I usually just have a counter in my loops and bomb out when I get to NNN. >Graceful, just like me .... Perhaps you didn't see the entire post. I can't 'bomb out' of a loop...I'm talking about SQL here... :( BTW, everyone, I've learned from an INFORMIX 3rd party application vendor that ROWID will disappear sometime in the future (near or far, I do not know). Thus, even the previous post (with a sort-of solution) will be invalid and unavailable to us (assuming my info is good). Recap: I use 'select count(*) from table where rowid < 100', see how many rows 'fit' in that range, then run the actual query with that number; if not enough (or too much) info comes back in my *real* query, I adjust the rowid number in the where clause. So, I'll ask again...has anyone discovered or fabricated a way (IN SQL) of limiting the # of rows returned (w/o huge CPU cost :) ???? Thanx, --- bgh -- William G. Hudacek Internet: whudace@dad.bgsu.edu University Computer Services Bowling Green State University