我有一ACCESS数据库中的表如下:
node value
2303 34.5
3408 32.7
2389 67.9
我想变成另一个表,带有字段ID,按value值由大到小来排序的:
ID value node
1 67.9 2389
2 34.5 2303
3 32.7 3408
写成生成表查询的语句如下:
SELECT ( select count(1) from Rb排序 where value >= a.value ) AS id, [value], [node], [extent] INTO RB FROM Rb排序 AS a ORDER BY [value] DESC
而对于上面这条语句,我想改为插入表查询INSERT INTO 的形式,如何写SQL语句?
我写成如下形式,还是不对,提示是INSERT INTO语句的语法错误,是否ACCESS不支持这种语法呢,应如何改?
INSERT INTO RB(id,value,node,extent)
SELECT ( select count(1) from Rb排序 where value >= a.value ) AS id,
[value], [node], [extent] FROM Rb排序 AS a ORDER BY [value] DESC
--------------------next---------------------
阅读(1037) | 评论(0) | 转发(0) |