如何在Select Statement中自动增加数字? [英] How can i increase number automatic in Select Statement?
本文介绍了如何在Select Statement中自动增加数字?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好,所有专家,
我有这样的数据:
A 1
B 2
C 3
D 4
E 5
F 6
我7
注意:
A,B,C,D,E ..是表1的一个字段,而1,2,3 ....不是表1的字段
如何显示2列和上面相同的格式?
谢谢
TONY
Hi all experts,
i have data like this:
A 1
B 2
C 3
D 4
E 5
F 6
I 7
Note:
A,B,C,D,E.. is one field of table1 and 1,2,3.... is not field
How can i display 2 columns and the same format like above?
Thanks
TONY
推荐答案
在第二个列查询中,您可以将
(ROW_NUMBER()OVER(ORDER BY [第一列名称]))
像:插入EMP值(1,ROW_NUMBER()OVER(ORDER BY [first column name]))
In your second Column query you can put
(ROW_NUMBER() OVER(ORDER BY [first column name]))
like: insert into EMP values (1,ROW_NUMBER() OVER(ORDER BY [first column name]))
这篇关于如何在Select Statement中自动增加数字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文