我試圖以某種方式解決我的 PSQL 查詢中的錯誤 ambiguous origin_type column name
查詢
SELECT
*
FROM
"message"
INNER JOIN "member" ON "member"."id" = "message"."member_id"
INNER JOIN "conversation" ON "conversation"."id" = "message"."conversation_id"
WHERE
"message_type" in('USER_MESSAGE')
AND "origin_type" in('CONSENTEE_RECIPIENT')
AND "origin_type" in('CONSENTEE')
我有 2 列同名,需要一種方法來避免此錯誤,但由于我目前不實用,因此我被阻止,因為不知道解決此問題的更好方法。
我嘗試使用別名但沒有成功
uj5u.com熱心網友回復:
您應該使用"member"."origin_type"or"conversation"."origin_type"或"message"."origin_type"而不是僅僅"origin_type"取決于origin_type您需要哪個表。
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/391471.html
標籤:PostgreSQL的
上一篇:參考的表中不存在鍵,但似乎是的
