What is difference between ROWNUM and ROWID.

Questions by globalanil18   answers by globalanil18

Showing Answers 1 - 10 of 10 Answers

Rowid is a unique hexadecimal format integer that is created by database like oracle immediately for each row .Rownum refers the count of number of rows resulting from a resultant query. Rownum always starts for each row from the beginning number one.

  Was this answer useful?  Yes

One important common point about both rowid and rownum is both are pseudo columns. Pseudo columns refers that they both are not stored physically but can be used virtually in any select statement.

  Was this answer useful?  Yes

Also as mentioned by our friend rowid is a unique hexadecimal format integer which takes up the representation as below
      File: Block: Row

One can retrieve rowid by using the statement as below:
       SELECT rowid FROM SYS.DUAL;

This would return the unique 16 digit hexadecimal representation associated with the particular row.

  Was this answer useful?  Yes

Oracle ROWID uniquely identifies where a row resides on disk.  The information in a ROWID gives Oracle everything it needs to find your row, the disk number, the cylinder, block and offset into the block. It actually the physical address.
ROWID can be used to fetch a row from database.
ROWID is permanent.
Whereas,
ROWNUM is a "pseudo-column",
ROWNUM is used to restrict the number of rows in a query.
ROWNUM is temporary.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions