Showing posts with label justify right. Show all posts
Showing posts with label justify right. Show all posts

Monday, March 03, 2014

Justify Left, Centre and Right

This was tested on Oracle 11.2. NUMBER items and their column headings are right justified by default:
 
SQL> set numwidth 15
SQL> select count(*) table_count from dba_tables
  2  /
 
    TABLE_COUNT
---------------
           3110
 
SQL>
 
If you want to see the heading in the centre of the column, you can do so with justify centre:
 
SQL> col table_count justify centre
SQL> select count(*) table_count from dba_tables
  2  /
 
  TABLE_COUNT
---------------
           3110
 
SQL>
 
If you want to see the heading to the left of the column, you can do so with justify left:
 
SQL> col table_count justify left
SQL> select count(*) table_count from dba_tables
  2  /
 
TABLE_COUNT
---------------
           3110
 
SQL>
 
VARCHAR2 items and their column headings are left justified by default:
 
SQL> select table_name from dba_tables
  2  where rownum = 1
  3  /
 
TABLE_NAME
------------------------------
CON$
 
SQL>
 
If you want to see the heading in the centre of the column, you can do so with justify centre:
 
SQL> col table_name justify centre
SQL> select table_name from dba_tables
  2  where rownum = 1
  3  /
 
          TABLE_NAME
------------------------------
CON$
 
SQL>
 
If you want to see the heading to the right of the column, you can do so with justify right:
 
SQL> col table_name justify right
SQL> select table_name from dba_tables
  2  where rownum = 1
  3  /
 
                    TABLE_NAME
------------------------------
CON$