首页 新闻 会员 周边

sql统计问题

0
悬赏园豆:5 [已关闭问题] 关闭于 2013-02-22 21:54

create table testDB
(
id int identity(1,1) primary key,
name varchar(20) not null,
sales dec(18,2)
)

insert into testDB values('张三',10)
insert into testDB values('李四',20)
insert into testDB values('王五',30)
insert into testDB values('赵立权',40)
insert into testDB values('张华',50)
insert into testDB values('周杰',60)

普通查询结果如下:
select * from testDB

 

现在我需要在查询结果中再加一列像以下形式的统计,这个sql该怎么写呢?

Haydy的主页 Haydy | 初学一级 | 园豆:177
提问于:2013-02-22 21:04
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册