![](/img/trans.png)
[英]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.