![]() |
#2
msgj2009-10-11 11:32
|
一段SQL代码不理解,请高手解释一下?
通过下面的代码可以为TABLE1添加序号字段。
不过自己对于(select count(*) from TABLE1 where 类别<=tb.类别)不理解,请高手解释解释?多谢!!
select (select count(*) from TABLE1 where 类别<=tb.类别),类别 from TABLE1 tb
类别
A
W
S
D
序号 类别
1 A
2 W
3 S
4 D