比如返回:
A B
1 dsfsdf
2 sddsfds
3 dsfsdf
... ...类似于 select identity(1,1), B from tableA但identity(1,1)是错的,正确的语法是什么?
A B
1 dsfsdf
2 sddsfds
3 dsfsdf
... ...类似于 select identity(1,1), B from tableA但identity(1,1)是错的,正确的语法是什么?
解决方案 »
- if not object_id('Tempdb..#T') is null drop table #T??
- SQLserver2000备份时出错
- 在线等待,求一条对我来说 巨难的sql语句
- 行列转换处理,求高手帮写一下
- sa密码不能启用
- 请教:请问怎么查询出一个表最后100条记录?
- SQL中如何创建非聚集索引
- 把40M的广本数据导入到SQL后,为什么连接数据库会变得那么慢?
- 恢复数据库错误:tableIndex < ARRAY_LEN (upgradeMap),什么意思,咋办?
- 一个left outer join的问题,请帮助啊,立刻结帖!
- 一条查询语句,查找一条记录,已经知道在结果表中的第n行,我想用一个sql语句直接找到它的a字段的内容
- SQL2000在安装选择,验证模式后自动退出.
alter table tableA add id int identity(1,1)
select id=identity(int,1,1),b from tablea
-------------------------------------
服务器: 消息 177,级别 15,状态 1,行 1
仅当 SELECT 语句中有 INTO 子句时,才能使用 IDENTITY 函数。
--sql 2000 中 A: 临时表 B: 临时字段 C:关键字生成序号. 这几种方式.
select (select count(*) from t1 where t1.b<=tt1.b)as id ,tt1.b from t1 as tt1 order by b