0
我從MySQL遷移數據庫Postgrsql。在MySQL中我創建一個視圖這樣的:列作爲別名ambigous在PostgreSQL
create or replace view translated_attributes_with_attribute_templatevalues as
select
concat_ws('',
translated_attributevalues.attribute_id,
translated_attributevalues.languagecode,
attribute_template_value.id
) AS id,
...
GROUP BY id
但Postgrsql我得到的消息:
列引用 「身份證」 是不明確的 LINE 1:... GROUP BY ID
如何我可以使用別名「ID」嗎?
我改名,但不是代碼休息的其他部分,因爲它假設列被命名爲ID。
謝謝大家Laurenz。它工作完美。 – Gunnar
然後,您可能想要接受答案爲「正確」。 –