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 ?