[英]PostgreSQL SQL Error [42703]: ERROR: column 'minute' does not exist
[英]PGSQL Error Code 42703 column does not exist
我在postgreSQL中有一个数据库。 我想从那里读取一些数据,但是执行命令时出现错误( column anganridref does not exist
)。
这是我的NpgsqlCommand:
cmd.CommandText = "select * from angebot,angebotstatus,anrede where anrid=anganridref and anstaid=anganstaidref";
和我的3张桌子
我列的名称是权利。 所以我不明白为什么会出现这个错误。 有人可以解释我为什么会崩溃? 它不是大小写问题。
您没有在where子句中添加列名的前缀:
select *
from angebot,
angebotstatus,
anrede
where anrid = anganridref <-- missing tablenames for the columns
and anstaid = anganstaidre
还建议使用显式JOIN
代替旧的SQL 89隐式JOIN
语法:
select *
from angebot
join angebotstatus on angebot.aaaa = angebotstatus.bbbb
join anrede on angebot.aaaa = anrede.bbbb
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.