【发布时间】:2018-10-23 06:33:36
【问题描述】:
我从 2 个表中选择命令时遇到问题。
所以我有 table1:
table1_id = int pk;
table1_name;
table1_surname;
table1_age;
table1_address;
table1_city;
和table2:
table2_id int pk
table1_id int fk references table1.table1_id;
table3_id;
table2_description;
当我写下面的 select 语句时,我得到了不明确的列名 table1.table1_name 错误:
SELECT table2.table2_id, table2.table1_id, table1.table1_name, table2.table2_description
from table1,
table2 inner join
table1
on table2.table1_id = table1.table1_id;
老实说,我不明白这有什么问题?
【问题讨论】:
-
"老实说,我不明白这有什么问题?"试试谷歌或 Stackoverflow 搜索,我确定其他人之前有过这个错误。
-
从表和连接表1?