Formatting query results

One: Introduction

SELECT data out of the original; we want to format it

II: Format Columns 

1, change the column headings (COLUMN)

COLUMN ENAME HEADING EMPLOEE
SELECT ENAME
FROM EMP

2, a plurality of word

 

COLUMN ENAME HEADING 'EMPLOEE NAME'
SELECT ENAME
FROM EMP

3, Branch

COLUMN ENAME HEADING 'EMPLOEE |NAME'
SELECT ENAME
FROM EMP

 

4, (to display such digital format)

COLUMN SAL FORMAT $99,990
SELECT SAL
FROM EMP

 

5, (A apart from the display only as 4; much longer appear on the back)

COLUMN ENAME FORMAT A4
COLUMN  ENAME HEADING EMPLOYEE
SELECT ENAME 
FROM EMP

6, the code represents the excess, do not

SET WARP OFF
COLUMN ENAME FORMAT A4
COLUMN  ENAME HEADING EMPLOYEE
SELECT ENAME 
FROM EMP

5 and 6 above I'll have to test

7. Copy the SAL things in to COMM

COLUMN SAL FORMAT $99990
COLUMN COMM LIKE SAL
SELECT COMM
FROM EMP

 

8. List and resets the column display properties

COLUMN Column Name: Lists the specified display attributes more

COLUMN: List all more display properties

COLUMN column name CLEAR: The specified column display attributes are restored to default values

9: Inhibition of recovery column and display attributes

COLUMN column name OFF

ON COLUMN column name

8 and 9 and I do not quite understand, after testing;

10. WRAP column values ​​printed after the separate line (not understand this)

Before you stop it I feel no need to see from 62-74, if with less, if I look at the future use;

Published 153 original articles · won praise 15 · Views 150,000 +

Guess you like

Origin blog.csdn.net/beyond911/article/details/103844058