一.查询第二个字母是t或者a的雇员的全部信息
复制代码 代码如下:
select *
from employees
where firstname like '_[t,a]%'
二.更改字段名
复制代码 代码如下:
select '名字' = firstname ,'姓氏' = lastname
from employees
where firstname like '_[t,a]%'
复制代码 代码如下:
select firstname as '名字' , lastname as '姓氏'
from employees
where firstname like '_[t,a]%'
复制代码 代码如下:
/*检索出符合条件的前70%条记录*/
select top 70 percent firstname as '名字' , lastname as '姓氏'
from employees
where firstname like '_[t,a]%'1 /*检索出符合条件的前2条记录*/
select top 2 firstname as '名字' , lastname as '姓氏'
from employees
where firstname like '_[t,a]%'
复制代码 代码如下:
select *
from employees
where target='_blank'>服务器: 消息 8163,级别 16,状态 4,行 1
不能以 DISTINCT 方式选择 text、ntext 或 image 数据类型。
复制代码 代码如下:
select *
from employees
where src="http://www.vevb.com/uploads/allimg/130603/111U2NF_1.jpg">
注意:order by是必须的,并且 compute by后的参数应该在order by后的参数中出现过
复制代码 代码如下:
select sex,sclass,score
from student
compute sum(score)
新闻热点
疑难解答