Hello, i use oracle 8i on win nt. i have a table and i just want make a select statement which shows me the first row of the table. How can i do that ?
The proposed solution will not nessesarily give you the first row. You have to order the selected rows (order by ...) to qualify the rigth row. Else you may get different rows when executing the statement.
SELECT * FROM my_table
WHERE rowid = (SELECT min(rowid) FROM my_table);
This should give you the first physical row in the table. However, since Oracle recycles space as it becomes available, this will not necessarily be the first chronilogical row in the table.
Well, I meant first row for that particular query (every execution of it). Since Oracle, and ANSI SQL, say tables are a set (i.e. not ordered), you cannot have "first" row in a chronologycal sense. If you want to have this order, you'll have to maintain it, for example you can have a sequence-generated column in your table.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.