tufanv Expert Licensed User Longtime User Feb 10, 2018 #1 HEllo, When I add a kvs's all the keys to a list they are added alphabetically , is it possible to list them according to row number like : last added will be last and first added will be first . I checked this code: Code: Copy Public Sub ListKeys As List Dim c As ResultSet = sql1.ExecQuery("SELECT key FROM main") Dim res As List res.Initialize Do While c.NextRow res.Add(c.GetString2(0)) Loop c.Close Return res End Sub but I couldnt find why it lists the alphabetically as "select key from main" must not sort them like this. TY
HEllo, When I add a kvs's all the keys to a list they are added alphabetically , is it possible to list them according to row number like : last added will be last and first added will be first . I checked this code: Code: Copy Public Sub ListKeys As List Dim c As ResultSet = sql1.ExecQuery("SELECT key FROM main") Dim res As List res.Initialize Do While c.NextRow res.Add(c.GetString2(0)) Loop c.Close Return res End Sub but I couldnt find why it lists the alphabetically as "select key from main" must not sort them like this. TY
M Mahares Expert Licensed User Longtime User Feb 10, 2018 #2 tufanv said: last added will be last and first added will be first Click to expand... Try this, Code: Copy Dim c As ResultSet = sql1.ExecQuery("SELECT key FROM main ORDER BY rowid") Upvote 0
tufanv said: last added will be last and first added will be first Click to expand... Try this, Code: Copy Dim c As ResultSet = sql1.ExecQuery("SELECT key FROM main ORDER BY rowid")
tufanv Expert Licensed User Longtime User Feb 10, 2018 #3 Mahares said: Try this, Code: Copy Dim c As ResultSet = sql1.ExecQuery("SELECT key FROM main ORDER BY rowid") Click to expand... yes works perfect thanks. I didnt know that we could use rowid for sorting with rownumber Upvote 0
Mahares said: Try this, Code: Copy Dim c As ResultSet = sql1.ExecQuery("SELECT key FROM main ORDER BY rowid") Click to expand... yes works perfect thanks. I didnt know that we could use rowid for sorting with rownumber