title: Sqlite : ambiguous column name
body: <p>I'm a newbie and i try to do that on my database</p>
  
  <blockquote>
    <p>SELECT id FROM import a INNER JOIN import b ON a.id-1 =b.id AND b.val =0 WHERE a.val=-1</p>
  </blockquote>
  
  <p>Pb : <strong>ambiguous column name: id</strong></p>
  
  <p>My table :</p>
  
  <pre><code>CREATE TABLE "import" (
      "id" INTEGER PRIMARY KEY  NOT NULL ,
      "id_analyse" integer, 
      "cross" varchar,
      "date" datetime,
      "close" double,
      "low" double,
      "high" double,
      "T" integer DEFAULT (NULL) ,
      "B" INTEGER
   )
  </code></pre>
  
  <p>I can't understand because i read </p>
  
  <blockquote>
    <p>When more than one table is used (in a JOIN for example) there may be two columns with the same name.</p>
  </blockquote>
  
  <p>And i use only one table !</p>
  
  <p>is there somebody who can help me ?</p>
  
  <p>stephane</p>