sql语句错误:“列..不存在”

我尝试从postgres控制台此命令:


select sim.id as idsim, 

       num.id as idnum 

from main_sim sim 

  left join main_number num on (FK_Numbers_id=num.id);

我得到了这个回应:


错误:列“ fk_numbers_id”不存在

第1行:...从main_sim sim左移,在(FK_Numbers ...

但是如果我只是用以下方法检查我的桌子:


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

...我们可以看到该列存在。


可能是语法错误,但我看不到...


任何帮助将不胜感激。亚历西奥


慕村225694
浏览 850回答 1
1回答
打开App,查看更多内容
随时随地看视频慕课网APP