obtain number row in access
SQL Server:
SELECT col1, col2,ROW_NUMBER() OVER (order BY col1) AS intRow FROM Table1
What is 开发者_如何学编程the equivalent code in Access?
In short, there is no equivalent. If you want a sequence, one way to do it is to create a table with an AutoNumber column. Another way would be something like:
Select ..,
, (
Select Count(*)
From MyTable As T1
Where T1.PrimaryKeyCol < T.PrimaryKeyCol
) + 1 As Seq
From MyTable As T
However, if the table is large, that may not perform well.
精彩评论