On 26 Dec 2012, at 1:36pm, genliu777 <doityth...@163.com> wrote:

> as you sayed, knowing the ROWID means i can deal with the SQL query which
> you mention to move back or move forwark through the table! but,  i  do not
> get the ROWID really yet and  further do not  know how to get the ROWID by
> any API funtion supplied by sqlite3!!!

rowid is a special column especially made by SQLite.  Suppose you define a 
table like

CREATE TABLE myTable (a INTEGER, b TEXT)

even though you did not ask for a column called rowid, SQLite will create one 
anyway.  It's a special secret column !  It will contain a numeric value which 
automatically increments for each new row: 1, 2, 3 ...

If you ask for

SELECT * FROM myTable

you will not get a value for rowid, because it's a secret column.  But if you 
explicitly ask for it:

SELECT rowid FROM myTable
SELECT b,rowid FROM myTable
SELECT rowid,* FROM myTable

then SQLite will return its value.  Try it out !

SQLite has been making this column for every table you've made, unless you 
define a column called rowid yourself.  So you can use this column on tables in 
old databases you already have.  You don't need to start a new one.

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to