Change the query result column names

A Student column names as wanted in column A of the table changed to B, then there are:

select A as 'B' 
from student;

NOTES:

The select clause is not to check the properties listed in the table, but when the expression, the expression that the query results column-name is not listed,

The codes;

select sname,2014-sage
from student

Effects such as:

sname no column name

At this point you can add as clause,

Code such as:

select sname,2014-sage as '2014-sage'
from student

Effects such as:

sname 2014-sage

 

Guess you like

Origin www.cnblogs.com/Neavotre/p/11464959.html