title: sqlite views have no rowid values
body: <p>I discovered the hardway that views has no rowid, is that expected? Here is a streamlined example.</p>
  
  <pre><code>create table t2 (u text);
  insert into t2 values ('x');
  insert into t2 values ('y');
  create table t1 (t text, i integer);
  insert into t1 values ('a',1);
  insert into t1 values ('b',2);
  insert into t1 values ('c',1);
  insert into t1 values ('d',2);
  create view v as select * from t1 join t2 on t1.i=t2.rowid;
  select rowid,* from t1;
  ro t  i
  -- -- --
  1  a  1
  2  b  2
  3  c  1
  4  d  2
  select rowid,* from v;
  ro t  i  u
  -- -- -- ----------
     a  1  x
     b  2  y
     c  1  x
     d  2  y
  </code></pre>
  
  <p>I worked around this by adding an 'ID' column to t1 where ID=rowid. </p>
  
  <p>I did a quick ^F 'rowid' on the sqlite VIEW web page and found no reference to rowid. A quick google at it give many matches regarding NO ROWID, so I didn't find an answer. </p>
  
  <p>I wanted to know if I misused the view. Basically the view is a way for me to present a single table that link together several related tables. Yet I need to access the view by its 'rowid'. To avoid discution about why using rowid instead of ID column, the reason is that my table are write-once (by a data extractor) then read-only. The data extractor knows what it entered and where then knows the rowid, then avoid to create a redundant column.</p>