Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Basic Math question on bytes to GB conversion

TomJul 25 2013 — edited Jul 25 2013

version: 11.2

I have to frequently write queries like below which involves converting bytes to GigaBytes. I always divide the bytes 'three times' by 1024 as shown below.

SQL> select bytes/1024/1024/1024 gb, max_bytes/1024/1024/1024 MXBytes, tablespace_name from user_ts_quotas;

        GB    MXBYTES TABLESPACE_NAME

---------- ---------- ------------------------------

7.01971436          9  USERS


In my previous shop, one of my colleagues used a shorter version of this which still involves dividing bytes 'three times' by 1024 but is was 'shorter'. I forgot how that was done.

Do you guys divide bytes/1024/1024/1024 or do you have shorter equivalent ?

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 22 2013
Added on Jul 25 2013
6 comments
3,492 views