Hi, ALL, Consider the following schema: CREATE TABLE players( playerid INTEGER PRIMARY KEY, name TEXT, rank INTEGER);
CREATE TABLE leagueplayers( playerid INTEGER, leagueid INTEGER, current_rank INTEGER original_rank INTEGER); The fields rank, current_rank and original_rank are recent addition to the schema. Now the players table is populated with data and I wrote the following query to populate the leagueplayers table: INSERT INTO leagueplayers SELECT players.playerid, %d, ... ORDER BY players.rank; Now my language of choice is C++ and what I'm looking for is a way to populate the current_rank and original_rank in the leagueplayers table. They should come up as auto-incremented values. So in the "INSERT INTO" query instead of "..." I should have some kind of function or something that will give me values of 1,2,3,4 and so forth. Is there a way to do that or I will have to change the query to do a transactional routine? Thank you. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users