drop table #t
create table #t([Auto] int,[f_1] nvarchar(50),[f_2] nvarchar(50),[f_3] int);
insert into #t select 1,'"1"','"1"',1
union all select 2,'"3"','"3"',2
union all select 3,'"2"','"2"',3
union all select 4,'"2"','"2"',4
union all select 5,'"5"','"5"',5
select * from #t
select * from (select min(Auto),f_1,f_2,SUM(f_3)As d from #t group by f_1,f_2)
create table #t([Auto] int,[f_1] nvarchar(50),[f_2] nvarchar(50),[f_3] int);
insert into #t select 1,'"1"','"1"',1
union all select 2,'"3"','"3"',2
union all select 3,'"2"','"2"',3
union all select 4,'"2"','"2"',4
union all select 5,'"5"','"5"',5
select * from #t
select * from (select min(Auto),f_1,f_2,SUM(f_3)As d from #t group by f_1,f_2)
解决方案 »
- 王珊的数据库系统概论对schema的讲解是否有误还是我理解不了?
- 请教一个求集合的SQL语句,谢谢
- being21 (民谣)进来解释一下!------楼主放分,我们同样是接分,为何单给playwarcraft(三角褲叉叉的頂點)50分!汗!!
- 如何知道别人登录我的SQLSERVER?
- 当我的某表中的数据添加时然后向操作员发送net send消息!这样能实现吗?
- 优化系统后导致无法安装完毕sql2000?
- 根据基本表结构及其数据生成 INSERT ... 的 SQL 语句
- 表遍历查询
- sql70的表导出来后到在65里为什么老报错(在线等,今天晚上需要答案)
- 高手请这边来瞧瞧
- 存储过程中根据参数的空值与否拼接语句
- 一个简单的问题
加两个a 一个是列的别名,最后一个是数据集的别名
后面加个别名!