码迷,mamicode.com
首页 > 数据库 > 详细

常用sql语句

时间:2016-10-19 14:23:40      阅读:228      评论:0      收藏:0      [点我收藏+]

标签:sql语句


SELECT total.tablespace_name,       Round(total.MB, 2)           AS Total_MB,       Round(total.MB - free.MB, 2) AS Used_MB,       Round(( 1 - free.MB / total.MB ) * 100, 2)       || ‘%‘                       AS Used_Pct FROM   (SELECT tablespace_name,               Sum(bytes) / 1024 / 1024 AS MB        FROM   dba_free_space        GROUP  BY tablespace_name) free,       (SELECT tablespace_name,               Sum(bytes) / 1024 / 1024 AS MB        FROM   dba_data_files        GROUP  BY tablespace_name) total WHERE  free.tablespace_name = total.tablespace_name;

常用sql语句

标签:sql语句

原文地址:http://10941098.blog.51cto.com/10931098/1863372

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!