Aliases rowid to rowid seems to work for me, i.e. SELECT rowid as rowid, primary_key_col
-Tom > -----Original Message----- > From: Will Leshner [mailto:[EMAIL PROTECTED] > Sent: Tuesday, April 12, 2005 5:36 PM > To: sqlite-users@sqlite.org > Subject: [sqlite] determing the primary key > > I realize that in sqlite 3, if I construct a query with 'rowid' as one > of the columns, and the table I am querying explicitly declares an > integer primary key column, my results have the table's name for the > column and not 'rowid'. What I'm wondering is if there is a good way > to determine which of the columns in my results is the primary key > column. It occurs to me that I could issue the query "select rowid > from blah limit 0" to get the real column name of the primary key > column. Is that likely to be my best approach? > > Thanks. >