I was trying to get the last record from a table using the following query.
SELECT *
FROM TABLE1
WHERE ROWID IN (SELECT MAX (ROWID) FROM TABLE1);
When I checked the ROWID
,
The value is AAAZA5eAFAAA7AAAA
And some other value for MIN(ROWID)
.
How this pseudocolumn
is getting evaluated here? It has also mentioned that Oracle Database does not guarantee that the values of such columns are valid rowids.So ROWID
values are not necessarily unique within a schema?
As per the doc: Each row in the database has an address. You can examine a row address by querying the pseudocolumn ROWID. Values of this pseudocolumn are strings representing the address of each row. These strings have the datatype ROWID. You can also create tables and clusters that contain actual columns having the ROWID datatype. Oracle Database does not guarantee that the values of such columns are valid rowids.