1.选择列
1)select 列名1,列名2...
from 表名
1)select 列名1,列名2...
from 表名
select sno,sname
from student
from student
2)所有列
select *
from 表名
select *
from 表名
3)计算列
select sno,grade+2 'newgrade'
from sc
select sno,grade+2 'newgrade'
from sc
select productID,price*stocks
from products
from products
select rtrim()sname+'是'+rtrim(ssex)+'生'
from student
from student
截取空格的函数
rtrim()
rtrim()
4)增加列标题
‘列标题’=列名
列名 [as] ‘列标题’
‘列标题’=列名
列名 [as] ‘列标题’
select '学号'=sno,sname as '姓名'
from student </
from student </