0

I'm numbering each row of the table

In my program I used the database SQLite

I use the following code in SQL sever:

SELECT ROW_NUMBER()over (order by len(GoodsID)),  LEN(GoodsID) as 'length' 
FROM inv.tblGoods
GROUP BY LEN(GoodsID)
ORDER BY LEN(GoodsID)

I want using the above code in SQLite .

But I do not know the equivalent ROW_NUMBER ?

Any help on either of these is greatly appreciated!

user2261110
  • 51
  • 1
  • 7
  • 2
    first hit in a ten second search: http://stackoverflow.com/questions/4074257/sqlite-equivalent-of-row-number-over-partition-by – Mitch Wheat May 08 '13 at 06:38

1 Answers1

1

you can implement it by creating another column in your table like this

row_number integer primary key autoincrement

Then get the row number by select row_number

stinepike
  • 54,068
  • 14
  • 92
  • 112