title: sql statement error: "column .. does not exist"
body: <p>Im trying from postgres console this command:</p>
  
  <pre><code>select sim.id as idsim, 
         num.id as idnum 
  from main_sim sim 
    left join main_number num on (FK_Numbers_id=num.id);
  </code></pre>
  
  <p>and I've got this response:</p>
  
  <pre>
  ERROR:  column "fk_numbers_id" does not exist
  LINE 1: ...m from main_sim sim left join main_number num on (FK_Numbers...
  </pre>
  
  <p>but if I simply check my table with:</p>
  
  <pre><code>dbMobile=# \d main_sim
  
   id              | integer               | not null default
  
   Iccid           | character varying(19) | not null
  
  ...
  
   FK_Device_id    | integer               | 
  
   FK_Numbers_id   | integer               | 
  
  Indexes:
      "main_sim_pkey" PRIMARY KEY, btree (id)
      "main_sim_FK_Numbers_id_key" UNIQUE, btree ("FK_Numbers_id")
      "main_sim_Iccid_key" UNIQUE, btree ("Iccid")
      "main_sim_FK_Device_id" btree ("FK_Device_id")
  Foreign-key constraints:
      "FK_Device_id_refs_id_480a73d1" FOREIGN KEY ("FK_Device_id") REFERENCES main_device(id) DEFERRABLE INITIALLY DEFERRED
      "FK_Numbers_id_refs_id_380cb036" FOREIGN KEY ("FK_Numbers_id") REFERENCES main_number(id) DEFERRABLE INITIALLY DEFERRED
  </code></pre>
  
  <p>...as we can see the column exist.</p>
  
  <p>probably it's syntax error, but I'm unable to see what...</p>
  
  <p>any help will'be appreciated.
  Alessio</p>