Re: Missing feature in informix?
Posted in 1996
At 09:23 PM 5/6/96 GMT, you wrote: }scottr@fourgen.com (Scott Rubin) writes: } }>At 09:19 AM 5/1/96, you wrote: }>>The following is missing in informix? }>>In oracle the server stops processing after selecting n rows thru }>> select * from tablea where rownum < 10 }>>In sybase equivalent is - }>> set rowcount 9 }>> select * from tablea }>>In informix ???!! } }>There is something in ISQL that will do this. }>See page 3-14 in Informix Guide to SQL Tutorial 4.10. }>But here is there select example: }>----------------------------------------------------------- }>select order_num, total_price }>from items a }>where 10 > }> (select count(*) }> from items b }> where b.total_price < a.total_price) }>order by total_price }>----------------------------------------------------------- }>This gives you the 10 highest priced items ordered } }Yes, this works but is slower than what I was thinking of. I liked the }"set rowcount 9" function in Sybase which just says give me the first 9 }rows of the query. After reading this last suggestion, I looked in the }book and found that Informix DOES have the equiv. functionality: } }select * from tablea where rowid < 10; } }Gives you the first 9 entries from "tablea" - Cool! }-- }---------------------------------------------------------------------------- }Daniel James - Database Administrator djames@statsci.com }Data Analysis Prod Div of MathSoft (formerly StatSci) (206) 283-8802 x284 } } What makes you think the select would return the desired rows with rowid 1 thru 9? The only way this would happen is if you created a (temp) table right before the select and inserted the 9 desired rows first. Yes, it would be cool if we had a 'set rowcount #', but we don't. Scott Rubin