M moonc Unregistered / Unconfirmed GUEST, unregistred user! 2001-12-07 #1 通过Query查询出来的记录,在用DBGrid中显示的时候, 我想在第一列自动添加序列号,怎么办呢?
U ugvanxk Unregistered / Unconfirmed GUEST, unregistred user! 2001-12-07 #2 QryTemp: begin create table #temptable (id:indefity; .. ); insert into #temptable select * from table select * from #temptable end; 先创建一临时库加一自增长字段,然后把结果插入
QryTemp: begin create table #temptable (id:indefity; .. ); insert into #temptable select * from table select * from #temptable end; 先创建一临时库加一自增长字段,然后把结果插入
Y yyanghhong Unregistered / Unconfirmed GUEST, unregistred user! 2001-12-07 #3 select rownum, * from tab, it is only for oracle
M moonc Unregistered / Unconfirmed GUEST, unregistred user! 2001-12-07 #5 oracle 的写法在SQL Server中不能用的,而我现在用的是SQL server。
Z zhanggeye Unregistered / Unconfirmed GUEST, unregistred user! 2001-12-07 #6 简单: SELECT IDENTITY(int,1,1) AS 序号,atable.* from atable
M moonc Unregistered / Unconfirmed GUEST, unregistred user! 2001-12-07 #7 ugvanxk : 谢谢你,本身我的Query的语句写的就比较复杂,有没有简单一点的方法呢? zhanggege:在Select语句中不能用Identity。
Z zhanggeye Unregistered / Unconfirmed GUEST, unregistred user! 2001-12-07 #10 不好意思 SELECT IDENTITY(int,1,1) AS 序号,atable.* into #temptable from atable select * from #temptable