0
How can I return the first 100 rows of a table without having to read all your records?
My table has 4 million lines , and I’m having trouble trying to return only your first 100 lines, because every time I use ROWNUM, sgbd reads the whole table (I think, since it takes hours to complete the query).
Example:
SELECT ACCT FROM ACCT_CUST AC WHERE AC.TYPE != "DT" AND ROWNUM < 100;
Oracle doesn’t have TOP or Limit, so I don’t know how to use rownum to pick up lines without reading the entire table
Rownum works the same as TOP or LIMIT, the only difference is the syntax. But this behavior indicates that you do not have an Word in the TYPE column. If you have an Input in this column, you can try forcing it to be used via the Choose directive.
– ceinmart